aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-03 23:25:26 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-03 23:25:26 +0000
commit5f6ac03b00adb3e019ef828fa0ecd2292192955d (patch)
tree1f188a2bdd246d9b1793c46c340aa6a977da1517 /src/gpu/gl
parentb83ec64dde35049e108ec29b263ec8aa580348b5 (diff)
Don't emit declaration of gl_FragPos unless also changing the origin.
R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/182003002 git-svn-id: http://skia.googlecode.com/svn/trunk@13648 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLShaderBuilder.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
index 264bc3b005..94568e034a 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -404,14 +404,11 @@ const char* GrGLShaderBuilder::fragmentPosition() {
return "";
}
}
+ // We only declare "gl_FragCoord" when we're in the case where we want to use layout qualifiers
+ // to reverse y. Otherwise it isn't necessary and whether the "in" qualifier appears in the
+ // declaration varies in earlier GLSL specs. So it is simpler to omit it.
if (fTopLeftFragPosRead) {
- if (!fSetupFragPosition) {
- fFSInputs.push_back().set(kVec4f_GrSLType,
- GrGLShaderVar::kIn_TypeModifier,
- "gl_FragCoord",
- GrGLShaderVar::kDefault_Precision);
- fSetupFragPosition = true;
- }
+ fSetupFragPosition = true;
return "gl_FragCoord";
} else if (fGpu->glCaps().fragCoordConventionsSupport()) {
if (!fSetupFragPosition) {