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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/sksl/sksl.include ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkSLCompiler.h" 8 #include "SkSLCompiler.h"
9 9
10 #include "Test.h" 10 #include "Test.h"
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 " switch (3) {\n" 857 " switch (3) {\n"
858 " case 0:\n" 858 " case 0:\n"
859 " x = 0.0;\n" 859 " x = 0.0;\n"
860 " case 1:\n" 860 " case 1:\n"
861 " x = 1.0;\n" 861 " x = 1.0;\n"
862 " }\n" 862 " }\n"
863 " sk_FragColor = vec4(x);\n" 863 " sk_FragColor = vec4(x);\n"
864 "}\n"); 864 "}\n");
865 } 865 }
866 866
867 DEF_TEST(SkSLRectangleTexture, r) {
868 test(r,
869 "uniform sampler2D test;"
870 "void main() {"
871 " sk_FragColor = texture(test, vec2(1));"
872 "}",
873 *SkSL::ShaderCapsFactory::Default(),
874 "#version 400\n"
875 "out vec4 sk_FragColor;\n"
876 "uniform sampler2D test;\n"
877 "void main() {\n"
878 " sk_FragColor = texture(test, vec2(1.0));\n"
879 "}\n");
880 test(r,
881 "uniform sampler2DRect test;"
882 "void main() {"
883 " sk_FragColor = texture(test, vec2(1));"
884 "}",
885 *SkSL::ShaderCapsFactory::Default(),
886 "#version 400\n"
887 "out vec4 sk_FragColor;\n"
888 "uniform sampler2DRect test;\n"
889 "void main() {\n"
890 " sk_FragColor = texture(test, textureSize(test) * vec2(1.0));\n"
891 "}\n");
892 test(r,
893 "uniform sampler2DRect test;"
894 "void main() {"
895 " sk_FragColor = texture(test, vec3(1));"
896 "}",
897 *SkSL::ShaderCapsFactory::Default(),
898 "#version 400\n"
899 "out vec4 sk_FragColor;\n"
900 "uniform sampler2DRect test;\n"
901 "void main() {\n"
902 " sk_FragColor = texture(test, vec3(textureSize(test), 1.0) * vec3(1 .0));\n"
903 "}\n");
904 }
905
867 #endif 906 #endif
OLDNEW
« 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