diff options
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index ea6b83f2b1..85a72600d0 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -44,10 +44,10 @@ void GrGLCaps::reset() { fFragCoordsConventionSupport = false; fVertexArrayObjectSupport = false; fES2CompatibilitySupport = false; + fMultisampleDisableSupport = false; fUseNonVBOVertexAndIndexDynamicData = false; fIsCoreProfile = false; fFullClearIsFree = false; - fFBMixedSamplesSupport = false; fReadPixelsSupportedCache.reset(); @@ -86,10 +86,10 @@ GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) { fFragCoordsConventionSupport = caps.fFragCoordsConventionSupport; fVertexArrayObjectSupport = caps.fVertexArrayObjectSupport; fES2CompatibilitySupport = caps.fES2CompatibilitySupport; + fMultisampleDisableSupport = caps.fMultisampleDisableSupport; fUseNonVBOVertexAndIndexDynamicData = caps.fUseNonVBOVertexAndIndexDynamicData; fIsCoreProfile = caps.fIsCoreProfile; fFullClearIsFree = caps.fFullClearIsFree; - fFBMixedSamplesSupport = caps.fFBMixedSamplesSupport; *(reinterpret_cast<GrGLSLCaps*>(fShaderCaps.get())) = *(reinterpret_cast<GrGLSLCaps*>(caps.fShaderCaps.get())); @@ -252,6 +252,12 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { fES2CompatibilitySupport = true; } + if (kGL_GrGLStandard == standard) { + fMultisampleDisableSupport = true; + } else { + fMultisampleDisableSupport = false; + } + this->initFSAASupport(ctxInfo, gli); this->initStencilFormats(ctxInfo); @@ -336,8 +342,6 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { // attachment, hence this min: fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize); - fFBMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples"); - fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker"); // Disable scratch texture reuse on Mali and Adreno devices @@ -935,6 +939,7 @@ SkString GrGLCaps::dump() const { r.appendf("Fragment coord conventions support: %s\n", (fFragCoordsConventionSupport ? "YES": "NO")); r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); + r.appendf("Multisample disable support: %s\n", (fMultisampleDisableSupport ? "YES" : "NO")); r.appendf("Use non-VBO for dynamic data: %s\n", (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO")); @@ -1054,6 +1059,15 @@ bool GrGLSLCaps::init(const GrGLContextInfo& ctxInfo, ctxInfo.hasExtension("GL_OES_standard_derivatives"); } + // We need dual source blending and the ability to disable multisample in order to support mixed + // samples in every corner case. + if (fDualSourceBlendingSupport && glCaps.multisampleDisableSupport()) { + // We understand "mixed samples" to mean the collective capability of 3 different extensions + fMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_samples") && + ctxInfo.hasExtension("GL_NV_sample_mask_override_coverage") && + ctxInfo.hasExtension("GL_EXT_raster_multisample"); + } + if (glCaps.advancedBlendEquationSupport()) { bool coherent = glCaps.advancedCoherentBlendEquationSupport(); if (ctxInfo.hasExtension(coherent ? "GL_NV_blend_equation_advanced_coherent" |