Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp

Issue 1523793002: Switch fragment coordinate to 'highp' to fix various broken GMs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index 47708f370d5d9c3f2f615ad5a6fdb6c82ae073af..54e0b7f9561eded3ab6a2c20cf1fe0e54b004bc8 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -146,9 +146,10 @@ const char* GrGLSLFragmentShaderBuilder::fragmentPosition() {
// depending on the surrounding code, accessing .xy with a uniform involved can
// do the same thing. Copying gl_FragCoord.xy into a temp vec2 beforehand
// (and only accessing .xy) seems to "fix" things.
- this->codePrependf("\tvec4 %s = vec4(%s.x, %s - %s.y, 1.0, 1.0);\n",
- kCoordName, kTempName, rtHeightName, kTempName);
- this->codePrependf("vec2 %s = gl_FragCoord.xy;", kTempName);
+ const char* precision = glslCaps->usesPrecisionModifiers() ? "highp " : "";
+ this->codePrependf("\t%svec4 %s = vec4(%s.x, %s - %s.y, 1.0, 1.0);\n",
+ precision, kCoordName, kTempName, rtHeightName, kTempName);
+ this->codePrependf("%svec2 %s = gl_FragCoord.xy;", precision, kTempName);
fSetupFragPosition = true;
}
SkASSERT(fProgramBuilder->fUniformHandles.fRTHeightUni.isValid());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698