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

Unified Diff: tests/SkSLGLSLTest.cpp

Issue 2489673002: added constant folding & branch elimination to skslc (Closed)
Patch Set: textureProj on rectangle textures now working Created 3 years, 8 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/sksl/sksl.include ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkSLGLSLTest.cpp
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index 51a1f6325d1f04ddb2c59f790db3687d5f0341d3..6151b942b3f37279d48b95e70edbf7f8aa0b1798 100644
--- a/tests/SkSLGLSLTest.cpp
+++ b/tests/SkSLGLSLTest.cpp
@@ -864,4 +864,43 @@ DEF_TEST(SkSLSwitch, r) {
"}\n");
}
+DEF_TEST(SkSLRectangleTexture, r) {
+ test(r,
+ "uniform sampler2D test;"
+ "void main() {"
+ " sk_FragColor = texture(test, vec2(1));"
+ "}",
+ *SkSL::ShaderCapsFactory::Default(),
+ "#version 400\n"
+ "out vec4 sk_FragColor;\n"
+ "uniform sampler2D test;\n"
+ "void main() {\n"
+ " sk_FragColor = texture(test, vec2(1.0));\n"
+ "}\n");
+ test(r,
+ "uniform sampler2DRect test;"
+ "void main() {"
+ " sk_FragColor = texture(test, vec2(1));"
+ "}",
+ *SkSL::ShaderCapsFactory::Default(),
+ "#version 400\n"
+ "out vec4 sk_FragColor;\n"
+ "uniform sampler2DRect test;\n"
+ "void main() {\n"
+ " sk_FragColor = texture(test, textureSize(test) * vec2(1.0));\n"
+ "}\n");
+ test(r,
+ "uniform sampler2DRect test;"
+ "void main() {"
+ " sk_FragColor = texture(test, vec3(1));"
+ "}",
+ *SkSL::ShaderCapsFactory::Default(),
+ "#version 400\n"
+ "out vec4 sk_FragColor;\n"
+ "uniform sampler2DRect test;\n"
+ "void main() {\n"
+ " sk_FragColor = texture(test, vec3(textureSize(test), 1.0) * vec3(1.0));\n"
+ "}\n");
+}
+
#endif
« no previous file with comments | « src/sksl/sksl.include ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698