Add couple of more GLSL ES 3.00 uint literal tests
authorPyry Haulos <phaulos@google.com>
Thu, 26 Mar 2015 16:16:50 +0000 (09:16 -0700)
committerPyry Haulos <phaulos@google.com>
Thu, 26 Mar 2015 16:16:50 +0000 (09:16 -0700)
Certain shader compiler had an issue where it treated "0u" as a signed
integer literal. This change adds targeted tests to catch that.

Change-Id: I18ba2906eca52c55f5cb4f30b55a4b2b498a1f6a

data/gles3/shaders/constants.test

index 93e71b7..d8752a1 100644 (file)
@@ -874,6 +874,38 @@ case uint_decimal_1
        ""
 end
 
+case uint_decimal_2
+       version 300 es
+       values { output uint out0 = 0; }
+       both ""
+               #version 300 es
+               ${DECLARATIONS}
+               void main ()
+               {
+                       ${SETUP}
+                       uint value = 0u;
+                       out0 = value;
+                       ${OUTPUT}
+               }
+       ""
+end
+
+case uint_decimal_3
+       version 300 es
+       values { output uint out0 = 0; }
+       both ""
+               #version 300 es
+               ${DECLARATIONS}
+               void main ()
+               {
+                       ${SETUP}
+                       uint value = 0U;
+                       out0 = value;
+                       ${OUTPUT}
+               }
+       ""
+end
+
 case uint_octal_0
        version 300 es
        values { output uint out0 = 15; }
@@ -952,6 +984,20 @@ case int_from_uint
        ""
 end
 
+case int_from_uint_2
+       expect compile_fail
+       version 300 es
+       both ""
+               #version 300 es
+               ${DECLARATIONS}
+               void main ()
+               {
+                       int value = 0u;
+                       ${POSITION_FRAG_COLOR} = vec4(0.0);
+               }
+       ""
+end
+
 case uint_from_int
        expect compile_fail
        version 300 es
@@ -966,6 +1012,20 @@ case uint_from_int
        ""
 end
 
+case uint_from_int_2
+       expect compile_fail
+       version 300 es
+       both ""
+               #version 300 es
+               ${DECLARATIONS}
+               void main ()
+               {
+                       uint value = 0;
+                       ${POSITION_FRAG_COLOR} = vec4(0.0);
+               }
+       ""
+end
+
 case int_from_float
        expect compile_fail
        version 300 es