aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/SkSLGLSLTest.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index d815b8c439..7c69de62be 100644
--- a/tests/SkSLGLSLTest.cpp
+++ b/tests/SkSLGLSLTest.cpp
@@ -470,6 +470,8 @@ DEF_TEST(SkSLHex, r) {
"u3++;"
"uint u4 = 0xffffffff;"
"u4++;"
+ "ushort u5 = 0xffff;"
+ "u5++;"
"}",
*SkSL::ShaderCapsFactory::Default(),
"#version 400\n"
@@ -493,6 +495,8 @@ DEF_TEST(SkSLHex, r) {
" u3++;\n"
" uint u4 = 4294967295u;\n"
" u4++;\n"
+ " uint u5 = 65535u;\n"
+ " u5++;\n"
"}\n");
}
@@ -1114,6 +1118,22 @@ DEF_TEST(SkSLArrayTypes, r) {
"}\n");
}
+DEF_TEST(SkSLArrayIndexTypes, r) {
+ test(r,
+ "void main() { float array[4] = float[4](1, 2, 3, 4);"
+ "short x = 0; ushort y = 1; int z = 2; uint w = 3;"
+ "sk_FragColor = float4(array[x], array[y], array[z], array[w]); }",
+ *SkSL::ShaderCapsFactory::Default(),
+ "#version 400\n"
+ "out vec4 sk_FragColor;\n"
+ "void main() {\n"
+ " sk_FragColor = vec4(float[4](1.0, 2.0, 3.0, 4.0)[0], "
+ "float[4](1.0, 2.0, 3.0, 4.0)[1], "
+ "float[4](1.0, 2.0, 3.0, 4.0)[2], "
+ "float[4](1.0, 2.0, 3.0, 4.0)[3]);\n"
+ "}\n");
+}
+
DEF_TEST(SkSLGeometry, r) {
test(r,
"layout(points) in;"