diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-05 23:44:09 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-09-05 23:44:09 +0000 |
commit | a8e5a06f69b7e0cb17a4b3203f0a7a1d52aa73ec (patch) | |
tree | 9832f6de86123cf15d0033f23be25ef89b3c0cf0 /src/gpu/gl/GrGLCaps.cpp | |
parent | 67db510c9c7f006fb4ec5027e5c859cfd71f42c0 (diff) |
Add support for ES3 MSAA.
R=robertphillips@google.com, jvanverth@google.com
Author: bsalomon@google.com
Review URL: https://chromiumcodereview.appspot.com/23404002
git-svn-id: http://skia.googlecode.com/svn/trunk@11124 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 382bfba68d..1488e75c29 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -386,17 +386,21 @@ void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa fMSFBOType = kNone_MSFBOType; if (kDesktop_GrGLBinding != ctxInfo.binding()) { - if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { - // chrome's extension is equivalent to the EXT msaa - // and fbo_blit extensions. - fMSFBOType = kDesktop_EXT_MSFBOType; - } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { - fMSFBOType = kES_Apple_MSFBOType; - } else if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { - fMSFBOType = kES_EXT_MsToTexture_MSFBOType; - } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture")) { - fMSFBOType = kES_IMG_MsToTexture_MSFBOType; - } + // We prefer the EXT/IMG extension over ES3 MSAA because we've observed + // ES3 driver bugs on at least one device with a tiled GPU (N10). + if (ctxInfo.hasExtension("GL_EXT_multisampled_render_to_texture")) { + fMSFBOType = kES_EXT_MsToTexture_MSFBOType; + } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture")) { + fMSFBOType = kES_IMG_MsToTexture_MSFBOType; + } else if (!GR_GL_IGNORE_ES3_MSAA && ctxInfo.version() >= GR_GL_VER(3,0)) { + fMSFBOType = GrGLCaps::kES_3_0_MSFBOType; + } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { + // chrome's extension is equivalent to the EXT msaa + // and fbo_blit extensions. + fMSFBOType = kDesktop_EXT_MSFBOType; + } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { + fMSFBOType = kES_Apple_MSFBOType; + } } else { if ((ctxInfo.version() >= GR_GL_VER(3,0)) || ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { @@ -569,6 +573,7 @@ void GrGLCaps::print() const { "None", "ARB", "EXT", + "ES 3.0", "Apple", "IMG MS To Texture", "EXT MS To Texture", @@ -576,9 +581,10 @@ void GrGLCaps::print() const { GR_STATIC_ASSERT(0 == kNone_MSFBOType); GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType); GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType); - GR_STATIC_ASSERT(3 == kES_Apple_MSFBOType); - GR_STATIC_ASSERT(4 == kES_IMG_MsToTexture_MSFBOType); - GR_STATIC_ASSERT(5 == kES_EXT_MsToTexture_MSFBOType); + GR_STATIC_ASSERT(3 == kES_3_0_MSFBOType); + GR_STATIC_ASSERT(4 == kES_Apple_MSFBOType); + GR_STATIC_ASSERT(5 == kES_IMG_MsToTexture_MSFBOType); + GR_STATIC_ASSERT(6 == kES_EXT_MsToTexture_MSFBOType); GR_STATIC_ASSERT(GR_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1); static const char* kFBFetchTypeStr[] = { |