diff options
-rw-r--r-- | src/gpu/ccpr/GrCCPathProcessor.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLCaps.cpp | 32 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/gpu/ccpr/GrCCPathProcessor.cpp b/src/gpu/ccpr/GrCCPathProcessor.cpp index 66005f13c2..568ceb7c69 100644 --- a/src/gpu/ccpr/GrCCPathProcessor.cpp +++ b/src/gpu/ccpr/GrCCPathProcessor.cpp @@ -154,14 +154,14 @@ void GLSLPathProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) { // N[0] is the normal for the edge we are intersecting from the regular bounding box, pointing // out of the octagon. - v->codeAppendf("float2 refpt = (min(N[0].x, N[0].y) < 0) ? %s.xy : %s.zw;", + v->codeAppendf("float2 refpt = float2[2](%s.xy, %s.zw)[sk_VertexID >> 2];", proc.getInstanceAttrib(InstanceAttribs::kDevBounds).fName, proc.getInstanceAttrib(InstanceAttribs::kDevBounds).fName); v->codeAppendf("refpt += N[0] * %f;", kAABloatRadius); // bloat for AA. // N[1] is the normal for the edge we are intersecting from the 45-degree bounding box, pointing // out of the octagon. - v->codeAppendf("float2 refpt45 = (N[1].x < 0) ? %s.xy : %s.zw;", + v->codeAppendf("float2 refpt45 = float2[2](%s.xy, %s.zw)[((sk_VertexID + 1) >> 2) & 1];", proc.getInstanceAttrib(InstanceAttribs::kDevBounds45).fName, proc.getInstanceAttrib(InstanceAttribs::kDevBounds45).fName); v->codeAppendf("refpt45 *= float2x2(.5,.5,-.5,.5);"); // transform back to device space. diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index f7eab7b457..14be2153a5 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -325,18 +325,23 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, shaderCaps->fShaderDerivativeSupport = ctxInfo.version() >= GR_GL_VER(3, 0) || ctxInfo.hasExtension("GL_OES_standard_derivatives"); - if (ctxInfo.version() >= GR_GL_VER(3,2)) { - shaderCaps->fGeometryShaderSupport = true; - } else if (ctxInfo.hasExtension("GL_EXT_geometry_shader")) { - shaderCaps->fGeometryShaderSupport = true; - shaderCaps->fGeometryShaderExtensionString = "GL_EXT_geometry_shader"; - } - if (shaderCaps->fGeometryShaderSupport && kQualcomm_GrGLDriver == ctxInfo.driver()) { - // Qualcomm driver @103.0 has been observed to crash compiling ccpr geometry shaders. - // @127.0 is the earliest verified driver to not crash. - shaderCaps->fGeometryShaderSupport = ctxInfo.driverVersion() >= GR_GL_DRIVER_VER(127,0); + // Mali has support for geometry shaders, but in practice with ccpr they are slower than the + // backup impl that only uses vertex shaders. + if (kARM_GrGLVendor != ctxInfo.vendor()) { + if (ctxInfo.version() >= GR_GL_VER(3,2)) { + shaderCaps->fGeometryShaderSupport = true; + } else if (ctxInfo.hasExtension("GL_EXT_geometry_shader")) { + shaderCaps->fGeometryShaderSupport = true; + shaderCaps->fGeometryShaderExtensionString = "GL_EXT_geometry_shader"; + } + if (shaderCaps->fGeometryShaderSupport && kQualcomm_GrGLDriver == ctxInfo.driver()) { + // Qualcomm driver @103.0 has been observed to crash compiling ccpr geometry + // shaders. @127.0 is the earliest verified driver to not crash. + shaderCaps->fGeometryShaderSupport = + ctxInfo.driverVersion() >= GR_GL_DRIVER_VER(127,0); + } + shaderCaps->fGSInvocationsSupport = shaderCaps->fGeometryShaderSupport; } - shaderCaps->fGSInvocationsSupport = shaderCaps->fGeometryShaderSupport; shaderCaps->fIntegerSupport = ctxInfo.version() >= GR_GL_VER(3, 0) && ctxInfo.glslGeneration() >= k330_GrGLSLGeneration; // We use this value for GLSL ES 3.0. @@ -392,11 +397,6 @@ void GrGLCaps::init(const GrContextOptions& contextOptions, fPreferClientSideDynamicBuffers = true; } - if (kARM_GrGLVendor == ctxInfo.vendor()) { - // Mali GPUs have rendering issues with CCPR. Blacklisting until we look into workarounds. - fBlacklistCoverageCounting = true; - } - if (!contextOptions.fAvoidStencilBuffers) { // To reduce surface area, if we avoid stencil buffers, we also disable MSAA. this->initFSAASupport(contextOptions, ctxInfo, gli); |