OLD | NEW |
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 return true; | 379 return true; |
380 } | 380 } |
381 return false; | 381 return false; |
382 } | 382 } |
383 } | 383 } |
384 | 384 |
385 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
ce* gli) { | 385 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
ce* gli) { |
386 | 386 |
387 fMSFBOType = kNone_MSFBOType; | 387 fMSFBOType = kNone_MSFBOType; |
388 if (kDesktop_GrGLBinding != ctxInfo.binding()) { | 388 if (kDesktop_GrGLBinding != ctxInfo.binding()) { |
389 if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { | 389 // We prefer the EXT/IMG extension over ES3 MSAA because we've observed |
390 // chrome's extension is equivalent to the EXT msaa | 390 // ES3 driver bugs on at least one device with a tiled GPU (N10). |
391 // and fbo_blit extensions. | 391 if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { |
392 fMSFBOType = kDesktop_EXT_MSFBOType; | 392 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; |
393 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { | 393 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture")
) { |
394 fMSFBOType = kES_Apple_MSFBOType; | 394 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; |
395 } else if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture"))
{ | 395 } else if (!GR_GL_IGNORE_ES3_MSAA && ctxInfo.version() >= GR_GL_VER(3,0)
) { |
396 fMSFBOType = kES_EXT_MsToTexture_MSFBOType; | 396 fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; |
397 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture"))
{ | 397 } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample"))
{ |
398 fMSFBOType = kES_IMG_MsToTexture_MSFBOType; | 398 // chrome's extension is equivalent to the EXT msaa |
399 } | 399 // and fbo_blit extensions. |
| 400 fMSFBOType = kDesktop_EXT_MSFBOType; |
| 401 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { |
| 402 fMSFBOType = kES_Apple_MSFBOType; |
| 403 } |
400 } else { | 404 } else { |
401 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || | 405 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || |
402 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { | 406 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { |
403 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; | 407 fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType; |
404 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && | 408 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && |
405 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { | 409 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { |
406 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; | 410 fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType; |
407 } | 411 } |
408 // TODO: We could populate fMSAACoverageModes using GetInternalformativ | 412 // TODO: We could populate fMSAACoverageModes using GetInternalformativ |
409 // on GL 4.2+. It's format-specific, though. See also | 413 // on GL 4.2+. It's format-specific, though. See also |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 GrPrintf("Stencil Format %d, stencil bits: %02d, total bits: %02d\n", | 566 GrPrintf("Stencil Format %d, stencil bits: %02d, total bits: %02d\n", |
563 i, | 567 i, |
564 fStencilFormats[i].fStencilBits, | 568 fStencilFormats[i].fStencilBits, |
565 fStencilFormats[i].fTotalBits); | 569 fStencilFormats[i].fTotalBits); |
566 } | 570 } |
567 | 571 |
568 static const char* kMSFBOExtStr[] = { | 572 static const char* kMSFBOExtStr[] = { |
569 "None", | 573 "None", |
570 "ARB", | 574 "ARB", |
571 "EXT", | 575 "EXT", |
| 576 "ES 3.0", |
572 "Apple", | 577 "Apple", |
573 "IMG MS To Texture", | 578 "IMG MS To Texture", |
574 "EXT MS To Texture", | 579 "EXT MS To Texture", |
575 }; | 580 }; |
576 GR_STATIC_ASSERT(0 == kNone_MSFBOType); | 581 GR_STATIC_ASSERT(0 == kNone_MSFBOType); |
577 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); | 582 GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); |
578 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); | 583 GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); |
579 GR_STATIC_ASSERT(3 == kES_Apple_MSFBOType); | 584 GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); |
580 GR_STATIC_ASSERT(4 == kES_IMG_MsToTexture_MSFBOType); | 585 GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); |
581 GR_STATIC_ASSERT(5 == kES_EXT_MsToTexture_MSFBOType); | 586 GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); |
| 587 GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); |
582 GR_STATIC_ASSERT(GR_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); | 588 GR_STATIC_ASSERT(GR_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); |
583 | 589 |
584 static const char* kFBFetchTypeStr[] = { | 590 static const char* kFBFetchTypeStr[] = { |
585 "None", | 591 "None", |
586 "EXT", | 592 "EXT", |
587 "NV", | 593 "NV", |
588 }; | 594 }; |
589 GR_STATIC_ASSERT(0 == kNone_FBFetchType); | 595 GR_STATIC_ASSERT(0 == kNone_FBFetchType); |
590 GR_STATIC_ASSERT(1 == kEXT_FBFetchType); | 596 GR_STATIC_ASSERT(1 == kEXT_FBFetchType); |
591 GR_STATIC_ASSERT(2 == kNV_FBFetchType); | 597 GR_STATIC_ASSERT(2 == kNV_FBFetchType); |
(...skipping 24 matching lines...) Expand all Loading... |
616 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); | 622 GrPrintf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); |
617 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); | 623 GrPrintf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); |
618 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 624 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
619 GrPrintf("Fragment coord conventions support: %s\n", | 625 GrPrintf("Fragment coord conventions support: %s\n", |
620 (fFragCoordsConventionSupport ? "YES": "NO")); | 626 (fFragCoordsConventionSupport ? "YES": "NO")); |
621 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); | 627 GrPrintf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "
YES": "NO")); |
622 GrPrintf("Use non-VBO for dynamic data: %s\n", | 628 GrPrintf("Use non-VBO for dynamic data: %s\n", |
623 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 629 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
624 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); | 630 GrPrintf("Discard FrameBuffer support: %s\n", (fDiscardFBSupport ? "YES" : "
NO")); |
625 } | 631 } |
OLD | NEW |