diff options
author | cdalton <cdalton@nvidia.com> | 2016-02-05 09:35:20 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-05 09:35:20 -0800 |
commit | af8bc7d7a4fb1fbbc15bb0881a360ff0d7551ea2 (patch) | |
tree | da620ea1c34f51644f1e43c34879147e04df57ab /src/gpu/gl/GrGLCaps.cpp | |
parent | f6a84bdb477f1430b575d9e5743d055c0c170265 (diff) |
Add support for GL_EXT_raster_multisample
Updates the GrGLGpu to call glRasterSamplesEXT when multisample is
enabled for a mixed sampled render target, but the stencil test is not
active.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1666563003
Review URL: https://codereview.chromium.org/1666563003
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index d95e10ba64..1a87274b45 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -423,11 +423,18 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, // initFSAASupport() must have been called before this point if (GrGLCaps::kES_IMG_MsToTexture_MSFBOType == fMSFBOType) { - GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &fMaxColorSampleCount); + GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES_IMG, &fMaxStencilSampleCount); } else if (GrGLCaps::kNone_MSFBOType != fMSFBOType) { - GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &fMaxColorSampleCount); + GR_GL_GetIntegerv(gli, GR_GL_MAX_SAMPLES, &fMaxStencilSampleCount); } - fMaxStencilSampleCount = fMaxColorSampleCount; + // We only have a use for raster multisample if there is coverage modulation from mixed samples. + if (fUsesMixedSamples && ctxInfo.hasExtension("GL_EXT_raster_multisample")) { + GR_GL_GetIntegerv(gli, GR_GL_MAX_RASTER_SAMPLES, &fMaxRasterSamples); + // This is to guard against platforms that may not support as many samples for + // glRasterSamples as they do for framebuffers. + fMaxStencilSampleCount = SkTMin(fMaxStencilSampleCount, fMaxRasterSamples); + } + fMaxColorSampleCount = fMaxStencilSampleCount; if (kPowerVR54x_GrGLRenderer == ctxInfo.renderer() || kPowerVRRogue_GrGLRenderer == ctxInfo.renderer() || |