Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 23404002: Add support for ES3 MSAA. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGLCaps.h" 9 #include "GrGLCaps.h"
10 #include "GrGLContext.h" 10 #include "GrGLContext.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 return true; 370 return true;
371 } 371 }
372 return false; 372 return false;
373 } 373 }
374 } 374 }
375 375
376 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) { 376 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) {
377 377
378 fMSFBOType = kNone_MSFBOType; 378 fMSFBOType = kNone_MSFBOType;
379 if (kDesktop_GrGLBinding != ctxInfo.binding()) { 379 if (kDesktop_GrGLBinding != ctxInfo.binding()) {
380 if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { 380 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed
381 // chrome's extension is equivalent to the EXT msaa 381 // ES3 driver bugs on at least one device with a tiled GPU (N10).
382 // and fbo_blit extensions. 382 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) {
383 fMSFBOType = kDesktop_EXT_MSFBOType; 383 fMSFBOType = kES_EXT_MsToTexture_MSFBOType;
384 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { 384 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture") ) {
385 fMSFBOType = kES_Apple_MSFBOType; 385 fMSFBOType = kES_IMG_MsToTexture_MSFBOType;
386 } else if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { 386 } else if (!GR_GL_IGNORE_ES3_MSAA && ctxInfo.version() >= GR_GL_VER(3,0) ) {
387 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; 387 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType;
388 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture")) { 388 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) {
389 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; 389 // chrome's extension is equivalent to the EXT msaa
390 } 390 // and fbo_blit extensions.
391 fMSFBOType = kDesktop_EXT_MSFBOType;
392 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) {
393 fMSFBOType = kES_Apple_MSFBOType;
394 }
391 } else { 395 } else {
392 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || 396 if ((ctxInfo.version() >= GR_GL_VER(3,0)) ||
393 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { 397 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
394 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; 398 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType;
395 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && 399 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") &&
396 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { 400 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) {
397 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; 401 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType;
398 } 402 }
399 // TODO: We could populate fMSAACoverageModes using GetInternalformativ 403 // TODO: We could populate fMSAACoverageModes using GetInternalformativ
400 // on GL 4.2+. It's format-specific, though. See also 404 // on GL 4.2+. It's format-specific, though. See also
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 GrPrintf("Stencil Format %d, stencil bits: %02d, total bits: %02d\n", 557 GrPrintf("Stencil Format %d, stencil bits: %02d, total bits: %02d\n",
554 i, 558 i,
555 fStencilFormats[i].fStencilBits, 559 fStencilFormats[i].fStencilBits,
556 fStencilFormats[i].fTotalBits); 560 fStencilFormats[i].fTotalBits);
557 } 561 }
558 562
559 static const char* kMSFBOExtStr[] = { 563 static const char* kMSFBOExtStr[] = {
560 "None", 564 "None",
561 "ARB", 565 "ARB",
562 "EXT", 566 "EXT",
567 "ES 3.0",
563 "Apple", 568 "Apple",
564 "IMG MS To Texture", 569 "IMG MS To Texture",
565 "EXT MS To Texture", 570 "EXT MS To Texture",
566 }; 571 };
567 GR_STATIC_ASSERT(0 == kNone_MSFBOType); 572 GR_STATIC_ASSERT(0 == kNone_MSFBOType);
568 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); 573 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType);
569 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); 574 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType);
570 GR_STATIC_ASSERT(3 == kES_Apple_MSFBOType); 575 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType);
571 GR_STATIC_ASSERT(4 == kES_IMG_MsToTexture_MSFBOType); 576 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType);
572 GR_STATIC_ASSERT(5 == kES_EXT_MsToTexture_MSFBOType); 577 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType);
578 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType);
573 GR_STATIC_ASSERT(GR_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); 579 GR_STATIC_ASSERT(GR_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1);
574 580
575 static const char* kFBFetchTypeStr[] = { 581 static const char* kFBFetchTypeStr[] = {
576 "None", 582 "None",
577 "EXT", 583 "EXT",
578 "NV", 584 "NV",
579 }; 585 };
580 GR_STATIC_ASSERT(0 == kNone_FBFetchType); 586 GR_STATIC_ASSERT(0 == kNone_FBFetchType);
581 GR_STATIC_ASSERT(1 == kEXT_FBFetchType); 587 GR_STATIC_ASSERT(1 == kEXT_FBFetchType);
582 GR_STATIC_ASSERT(2 == kNV_FBFetchType); 588 GR_STATIC_ASSERT(2 == kNV_FBFetchType);
(...skipping 19 matching lines...) Expand all
602 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); 608 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO"));
603 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 609 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
604 GrPrintf("Fragment coord conventions support: %s\n", 610 GrPrintf("Fragment coord conventions support: %s\n",
605 (fFragCoordsConventionSupport ? "YES": "NO")); 611 (fFragCoordsConventionSupport ? "YES": "NO"));
606 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? " YES": "NO")); 612 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? " YES": "NO"));
607 GrPrintf("Use non-VBO for dynamic data: %s\n", 613 GrPrintf("Use non-VBO for dynamic data: %s\n",
608 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 614 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
609 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); 615 GrPrintf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO"));
610 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : " NO")); 616 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : " NO"));
611 } 617 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698