Only enable noperspective with ES3 shading language
This will never happen in real usage - the extension
requires ES3 support. However, we're likely to be
testing/running with ES3 and ES2 shading language to
work around driver bugs on other devices. Across many
devices, this was the only issue I found when forcing
ES2 shading language, so it seemed worth fixing.
Change-Id: I8b75c6935827c1a24c712cec4b36515581aea353
Reviewed-on: https://skia-review.googlesource.com/126640
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index a015315..4b77fc0 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -735,7 +735,8 @@
shaderCaps->fNoPerspectiveInterpolationSupport =
ctxInfo.glslGeneration() >= k130_GrGLSLGeneration;
} else {
- if (ctxInfo.hasExtension("GL_NV_shader_noperspective_interpolation")) {
+ if (ctxInfo.hasExtension("GL_NV_shader_noperspective_interpolation") &&
+ ctxInfo.glslGeneration() >= k330_GrGLSLGeneration /* GLSL ES 3.0 */) {
shaderCaps->fNoPerspectiveInterpolationSupport = true;
shaderCaps->fNoPerspectiveInterpolationExtensionString =
"GL_NV_shader_noperspective_interpolation";