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

Unified Diff: src/gpu/gl/GrGLShaderBuilder.cpp

Issue 345083002: Stop referencing gl_FragCoord z and w components. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix circle effect Created 6 years, 6 months 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 | « src/gpu/effects/GrRRectEffect.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLShaderBuilder.cpp
diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
index 4b2778c50308ae0838d6f73cf84af4c9d04d5279..c2ebce2a912ae984ad5a7c54b74057c30715de1e 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -499,7 +499,7 @@ const char* GrGLShaderBuilder::fragmentPosition() {
// declaration varies in earlier GLSL specs. So it is simpler to omit it.
if (fTopLeftFragPosRead) {
fSetupFragPosition = true;
- return "gl_FragCoord";
+ return "(gl_FragCoord.xy)";
} else if (fGpu->glCaps().fragCoordConventionsSupport()) {
if (!fSetupFragPosition) {
SkAssertResult(this->enablePrivateFeature(kFragCoordConventions_GLSLPrivateFeature));
@@ -510,7 +510,7 @@ const char* GrGLShaderBuilder::fragmentPosition() {
GrGLShaderVar::kUpperLeft_Origin);
fSetupFragPosition = true;
}
- return "gl_FragCoord";
+ return "(gl_FragCoord.xy)";
} else {
static const char* kCoordName = "fragCoordYDown";
if (!fSetupFragPosition) {
@@ -523,7 +523,7 @@ const char* GrGLShaderBuilder::fragmentPosition() {
fOutput.fUniformHandles.fRTHeightUni =
this->addUniform(kFragment_Visibility, kFloat_GrSLType, "RTHeight", &rtHeightName);
- this->fFSCode.prependf("\tvec4 %s = vec4(gl_FragCoord.x, %s - gl_FragCoord.y, gl_FragCoord.zw);\n",
+ this->fFSCode.prependf("\tvec2 %s = vec2(gl_FragCoord.x, %s - gl_FragCoord.y);\n",
kCoordName, rtHeightName);
fSetupFragPosition = true;
}
« no previous file with comments | « src/gpu/effects/GrRRectEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698