aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-01-16 13:52:29 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-16 14:12:31 +0000
commitcd3261ac65b579bf8555973362e58629b7adda6b (patch)
tree3e203b59dec27f08be49b28cb6794ca3e9acf51d /tests
parent485b8c639ca0dcfa0b378c19ae1009b4e9893e35 (diff)
Revert "Revert "Added SkSL workaround for devices which cannot safely access gl_FragCoord""
This reverts commit 9d6929cccfc3e64e75e6ef5b37f284b01b68fb28. Reason for revert: Re-landing, backfill reveals none of the red was related to this CL. Original change's description: > Revert "Added SkSL workaround for devices which cannot safely access gl_FragCoord" > > This reverts commit 1001f843a45e95f6df1d44242b6b06c77898e870. > > Reason for revert: Many failures. > > Original change's description: > > Added SkSL workaround for devices which cannot safely access gl_FragCoord > > > > This is the root cause of https://github.com/flutter/flutter/issues/13216 > > I've got a GM that demonstrates the bug, but only in Viewer. > > > > Bug: skia:7410 > > Change-Id: Iaa1f27b10166aa09e4dc5949e5a6ca1bd14c99ac > > Reviewed-on: https://skia-review.googlesource.com/93920 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Brian Osman <brianosman@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com > > Change-Id: I2a2edc0a8fa11fe9dac1045dc79ae91106518b02 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:7410 > Reviewed-on: https://skia-review.googlesource.com/94281 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=bsalomon@google.com,brianosman@google.com,ethannicholas@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:7410 Change-Id: Ib22bda7ff25bb7c8630cc6fa6dc809bf628ea853 Reviewed-on: https://skia-review.googlesource.com/94800 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/SkSLGLSLTest.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index 1ae421f8af..9b0571bcdc 100644
--- a/tests/SkSLGLSLTest.cpp
+++ b/tests/SkSLGLSLTest.cpp
@@ -1059,6 +1059,42 @@ DEF_TEST(SkSLFragCoord, r) {
"}\n",
&inputs);
REPORTER_ASSERT(r, !inputs.fRTHeight);
+
+ test(r,
+ "in float4 pos; void main() { sk_Position = pos; }",
+ *SkSL::ShaderCapsFactory::CannotUseFragCoord(),
+ "#version 400\n"
+ "out vec4 sk_FragCoord_Workaround;\n"
+ "in vec4 pos;\n"
+ "void main() {\n"
+ " sk_FragCoord_Workaround = (gl_Position = pos);\n"
+ "}\n",
+ SkSL::Program::kVertex_Kind);
+
+ test(r,
+ "in uniform float4 sk_RTAdjust; in float4 pos; void main() { sk_Position = pos; }",
+ *SkSL::ShaderCapsFactory::CannotUseFragCoord(),
+ "#version 400\n"
+ "out vec4 sk_FragCoord_Workaround;\n"
+ "in uniform vec4 sk_RTAdjust;\n"
+ "in vec4 pos;\n"
+ "void main() {\n"
+ " sk_FragCoord_Workaround = (gl_Position = pos);\n"
+ " gl_Position = vec4(gl_Position.x * sk_RTAdjust.x + gl_Position.w * sk_RTAdjust.y, "
+ "gl_Position.y * sk_RTAdjust.z + gl_Position.w * sk_RTAdjust.w, 0, gl_Position.w);\n"
+ "}\n",
+ SkSL::Program::kVertex_Kind);
+
+ test(r,
+ "void main() { sk_FragColor.xy = sk_FragCoord.xy; }",
+ *SkSL::ShaderCapsFactory::CannotUseFragCoord(),
+ "#version 400\n"
+ "in vec4 sk_FragCoord_Workaround;\n"
+ "out vec4 sk_FragColor;\n"
+ "void main() {\n"
+ " sk_FragColor.xy = vec4(sk_FragCoord_Workaround.xyz / sk_FragCoord_Workaround.w, "
+ "1.0 / sk_FragCoord_Workaround.w).xy;\n"
+ "}\n");
}
DEF_TEST(SkSLVertexID, r) {