Add more negative GLSL ES 3 uniform block tests.
authorMika Isojärvi <misojarvi@google.com>
Fri, 17 Apr 2015 00:40:49 +0000 (17:40 -0700)
committerMika Isojärvi <misojarvi@google.com>
Fri, 17 Apr 2015 00:40:49 +0000 (17:40 -0700)
Add new tests that test more invalid identifiers.

Change-Id: I138283623a98c980790e392b64d434dab33f51d4

android/cts/master/com.drawelements.deqp.gles3.xml
android/cts/master/gles3-master.txt
data/gles3/shaders/uniform_block.test
modules/gles3/scripts/gen-uniform-blocks.py

index 4acc4068be6906f059b95a825ad49bbef95f3f9d..7cccbe22a1e11117849c19bbbcdfc688cf5de4ea 100644 (file)
                                                <Test name="missing_block_name_fragment">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
-                                               <Test name="invalid_character_block_name_vertex">
+                                               <Test name="invalid_number_block_name_vertex">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
-                                               <Test name="invalid_character_block_name_fragment">
+                                               <Test name="invalid_number_block_name_fragment">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="invalid_hash_block_name_vertex">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="invalid_hash_block_name_fragment">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="invalid_dollar_block_name_vertex">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="invalid_dollar_block_name_fragment">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
                                                <Test name="invalid_identifier_block_name_vertex">
                                                <Test name="too_long_block_name_fragment">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
-                                               <Test name="invalid_character_instance_name_vertex">
+                                               <Test name="invalid_number_instance_name_vertex">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="invalid_number_instance_name_fragment">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="invalid_hash_instance_name_vertex">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="invalid_hash_instance_name_fragment">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="invalid_dollar_instance_name_vertex">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
-                                               <Test name="invalid_character_instance_name_fragment">
+                                               <Test name="invalid_dollar_instance_name_fragment">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
                                                <Test name="invalid_identifier_instance_name_vertex">
index 48b9ad7f3a28c6f62808c9b5d859090ad6d8416f..f7490c27ce1044a9efc677b56ff331ffed2ec785 100644 (file)
@@ -4573,14 +4573,22 @@ dEQP-GLES3.functional.shaders.uniform_block.invalid.member_layout_std140_vertex
 dEQP-GLES3.functional.shaders.uniform_block.invalid.member_layout_std140_fragment
 dEQP-GLES3.functional.shaders.uniform_block.invalid.missing_block_name_vertex
 dEQP-GLES3.functional.shaders.uniform_block.invalid.missing_block_name_fragment
-dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_character_block_name_vertex
-dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_character_block_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_number_block_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_number_block_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_hash_block_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_hash_block_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_dollar_block_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_dollar_block_name_fragment
 dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_identifier_block_name_vertex
 dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_identifier_block_name_fragment
 dEQP-GLES3.functional.shaders.uniform_block.invalid.too_long_block_name_vertex
 dEQP-GLES3.functional.shaders.uniform_block.invalid.too_long_block_name_fragment
-dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_character_instance_name_vertex
-dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_character_instance_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_number_instance_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_number_instance_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_hash_instance_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_hash_instance_name_fragment
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_dollar_instance_name_vertex
+dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_dollar_instance_name_fragment
 dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_identifier_instance_name_vertex
 dEQP-GLES3.functional.shaders.uniform_block.invalid.invalid_identifier_instance_name_fragment
 dEQP-GLES3.functional.shaders.uniform_block.invalid.double_underscore_block_name_vertex
index c5f6751ff48253329fa45446cd6c51580b3e2bc7..2a45400998334efc481090c16f0ea4ebeabb3139 100644 (file)
@@ -4135,7 +4135,7 @@ group invalid "Invalid uniform interface block syntax tests."
                        }
                ""
        end
-       case invalid_character_block_name_vertex
+       case invalid_number_block_name_vertex
                version 300 es
                expect compile_fail
 
@@ -4168,7 +4168,7 @@ group invalid "Invalid uniform interface block syntax tests."
                        }
                ""
        end
-       case invalid_character_block_name_fragment
+       case invalid_number_block_name_fragment
                version 300 es
                expect compile_fail
 
@@ -4201,6 +4201,138 @@ group invalid "Invalid uniform interface block syntax tests."
                        }
                ""
        end
+       case invalid_hash_block_name_vertex
+               version 300 es
+               expect compile_fail
+
+               vertex ""
+                       #version 300 es
+                       precision highp float;
+
+
+
+                       uniform #UniformBlock
+                       {
+                               vec4 uniformMember;
+                       } uniformBlock;
+
+                       void main()
+                       {
+                               gl_Position = uniformBlock.uniformMember;
+                       }
+               ""
+
+               fragment ""
+                       #version 300 es
+                       precision highp float;
+
+                       layout(location=0) out vec4 o_color;
+
+                       void main()
+                       {
+                               o_color = vec4(1.0);
+                       }
+               ""
+       end
+       case invalid_hash_block_name_fragment
+               version 300 es
+               expect compile_fail
+
+               vertex ""
+                       #version 300 es
+                       precision highp float;
+
+                       in vec4 a_pos;
+
+                       void main()
+                       {
+                               gl_Position = a_pos;
+                       }
+               ""
+
+               fragment ""
+                       #version 300 es
+                       precision highp float;
+
+                       layout(location=0) out vec4 o_color;
+
+                       uniform #UniformBlock
+                       {
+                               vec4 uniformMember;
+                       } uniformBlock;
+
+                       void main()
+                       {
+                               o_color = uniformBlock.uniformMember;
+                       }
+               ""
+       end
+       case invalid_dollar_block_name_vertex
+               version 300 es
+               expect compile_fail
+
+               vertex ""
+                       #version 300 es
+                       precision highp float;
+
+
+
+                       uniform $UniformBlock
+                       {
+                               vec4 uniformMember;
+                       } uniformBlock;
+
+                       void main()
+                       {
+                               gl_Position = uniformBlock.uniformMember;
+                       }
+               ""
+
+               fragment ""
+                       #version 300 es
+                       precision highp float;
+
+                       layout(location=0) out vec4 o_color;
+
+                       void main()
+                       {
+                               o_color = vec4(1.0);
+                       }
+               ""
+       end
+       case invalid_dollar_block_name_fragment
+               version 300 es
+               expect compile_fail
+
+               vertex ""
+                       #version 300 es
+                       precision highp float;
+
+                       in vec4 a_pos;
+
+                       void main()
+                       {
+                               gl_Position = a_pos;
+                       }
+               ""
+
+               fragment ""
+                       #version 300 es
+                       precision highp float;
+
+                       layout(location=0) out vec4 o_color;
+
+                       uniform $UniformBlock
+                       {
+                               vec4 uniformMember;
+                       } uniformBlock;
+
+                       void main()
+                       {
+                               o_color = uniformBlock.uniformMember;
+                       }
+               ""
+       end
        case invalid_identifier_block_name_vertex
                version 300 es
                expect compile_fail
@@ -4335,7 +4467,7 @@ group invalid "Invalid uniform interface block syntax tests."
                        }
                ""
        end
-       case invalid_character_instance_name_vertex
+       case invalid_number_instance_name_vertex
                version 300 es
                expect compile_fail
 
@@ -4368,7 +4500,7 @@ group invalid "Invalid uniform interface block syntax tests."
                        }
                ""
        end
-       case invalid_character_instance_name_fragment
+       case invalid_number_instance_name_fragment
                version 300 es
                expect compile_fail
 
@@ -4401,6 +4533,138 @@ group invalid "Invalid uniform interface block syntax tests."
                        }
                ""
        end
+       case invalid_hash_instance_name_vertex
+               version 300 es
+               expect compile_fail
+
+               vertex ""
+                       #version 300 es
+                       precision highp float;
+
+
+
+                       uniform UniformInstance
+                       {
+                               vec4 uniformMember;
+                       } $uniformBlock;
+
+                       void main()
+                       {
+                               gl_Position = $uniformBlock.uniformMember;
+                       }
+               ""
+
+               fragment ""
+                       #version 300 es
+                       precision highp float;
+
+                       layout(location=0) out vec4 o_color;
+
+                       void main()
+                       {
+                               o_color = vec4(1.0);
+                       }
+               ""
+       end
+       case invalid_hash_instance_name_fragment
+               version 300 es
+               expect compile_fail
+
+               vertex ""
+                       #version 300 es
+                       precision highp float;
+
+                       in vec4 a_pos;
+
+                       void main()
+                       {
+                               gl_Position = a_pos;
+                       }
+               ""
+
+               fragment ""
+                       #version 300 es
+                       precision highp float;
+
+                       layout(location=0) out vec4 o_color;
+
+                       uniform UniformInstance
+                       {
+                               vec4 uniformMember;
+                       } $uniformBlock;
+
+                       void main()
+                       {
+                               o_color = $uniformBlock.uniformMember;
+                       }
+               ""
+       end
+       case invalid_dollar_instance_name_vertex
+               version 300 es
+               expect compile_fail
+
+               vertex ""
+                       #version 300 es
+                       precision highp float;
+
+
+
+                       uniform UniformInstance
+                       {
+                               vec4 uniformMember;
+                       } $uniformBlock;
+
+                       void main()
+                       {
+                               gl_Position = $uniformBlock.uniformMember;
+                       }
+               ""
+
+               fragment ""
+                       #version 300 es
+                       precision highp float;
+
+                       layout(location=0) out vec4 o_color;
+
+                       void main()
+                       {
+                               o_color = vec4(1.0);
+                       }
+               ""
+       end
+       case invalid_dollar_instance_name_fragment
+               version 300 es
+               expect compile_fail
+
+               vertex ""
+                       #version 300 es
+                       precision highp float;
+
+                       in vec4 a_pos;
+
+                       void main()
+                       {
+                               gl_Position = a_pos;
+                       }
+               ""
+
+               fragment ""
+                       #version 300 es
+                       precision highp float;
+
+                       layout(location=0) out vec4 o_color;
+
+                       uniform UniformInstance
+                       {
+                               vec4 uniformMember;
+                       } $uniformBlock;
+
+                       void main()
+                       {
+                               o_color = $uniformBlock.uniformMember;
+                       }
+               ""
+       end
        case invalid_identifier_instance_name_vertex
                version 300 es
                expect compile_fail
index 535321317f578ce94df31d4f8c3aabad591826d0..24a4e8bccd040e7903b544ecbdc3488ca9246707 100644 (file)
@@ -687,7 +687,7 @@ void main()
        ${{OUTPUT}} = uniformBlock.uniformMember;
 }"""[1:]
 
-invalidCharacterBlockNameShaderTemplate = """
+invalidNumberBlockNameShaderTemplate = """
 #version 300 es
 precision highp float;
 
@@ -703,6 +703,38 @@ void main()
        ${{OUTPUT}} = uniformBlock.uniformMember;
 }"""[1:]
 
+invalidHashBlockNameShaderTemplate = """
+#version 300 es
+precision highp float;
+
+${{OUTPUT_DECLARATION}}
+
+uniform #UniformBlock
+{
+       vec4 uniformMember;
+} uniformBlock;
+
+void main()
+{
+       ${{OUTPUT}} = uniformBlock.uniformMember;
+}"""[1:]
+
+invalidDollarBlockNameShaderTemplate = """
+#version 300 es
+precision highp float;
+
+${{OUTPUT_DECLARATION}}
+
+uniform $UniformBlock
+{
+       vec4 uniformMember;
+} uniformBlock;
+
+void main()
+{
+       ${{OUTPUT}} = uniformBlock.uniformMember;
+}"""[1:]
+
 invalidIdentifierBlockNameShaderTemplate = """
 #version 300 es
 precision highp float;
@@ -736,7 +768,7 @@ void main()
        ${{OUTPUT}} = uniformBlock.uniformMember;
 }""")[1:]
 
-invalidCharacterInstanceNameShaderTemplate = """
+invalidNumberInstanceNameShaderTemplate = """
 #version 300 es
 precision highp float;
 
@@ -752,6 +784,38 @@ void main()
        ${{OUTPUT}} = 0uniformBlock.uniformMember;
 }"""[1:]
 
+invalidHashInstanceNameShaderTemplate = """
+#version 300 es
+precision highp float;
+
+${{OUTPUT_DECLARATION}}
+
+uniform UniformInstance
+{
+       vec4 uniformMember;
+} #uniformBlock;
+
+void main()
+{
+       ${{OUTPUT}} = #uniformBlock.uniformMember;
+}"""[1:]
+
+invalidDollarInstanceNameShaderTemplate = """
+#version 300 es
+precision highp float;
+
+${{OUTPUT_DECLARATION}}
+
+uniform UniformInstance
+{
+       vec4 uniformMember;
+} $uniformBlock;
+
+void main()
+{
+       ${{OUTPUT}} = $uniformBlock.uniformMember;
+}"""[1:]
+
 invalidIdentifierInstanceNameShaderTemplate = """
 #version 300 es
 precision highp float;
@@ -837,10 +901,14 @@ invalidCases = (
                        + sum([createCases("member_layout_%s" % qualifier, invalidMemberLayoutShaderTemplate % qualifier, False)
                                        for qualifier in ["shared", "packed", "std140"]], [])
                        + createCases("missing_block_name", missingBlockNameShaderTemplate, False)
-                       + createCases("invalid_character_block_name", invalidCharacterBlockNameShaderTemplate, False)
+                       + createCases("invalid_number_block_name", invalidNumberBlockNameShaderTemplate, False)
+                       + createCases("invalid_hash_block_name", invalidHashBlockNameShaderTemplate, False)
+                       + createCases("invalid_dollar_block_name", invalidDollarBlockNameShaderTemplate, False)
                        + createCases("invalid_identifier_block_name", invalidIdentifierBlockNameShaderTemplate, False)
                        + createCases("too_long_block_name", tooLongIdentifierBlockNameShaderTemplate, False)
-                       + createCases("invalid_character_instance_name", invalidCharacterInstanceNameShaderTemplate, False)
+                       + createCases("invalid_number_instance_name", invalidNumberInstanceNameShaderTemplate, False)
+                       + createCases("invalid_hash_instance_name", invalidDollarInstanceNameShaderTemplate, False)
+                       + createCases("invalid_dollar_instance_name", invalidDollarInstanceNameShaderTemplate, False)
                        + createCases("invalid_identifier_instance_name", invalidIdentifierInstanceNameShaderTemplate, False)
                        + createCases("double_underscore_block_name", doubleUnderscoreIdentifierBlockNameShaderTemplate, False)
                        + createCases("double_underscore_instance_name", doubleUnderscoreIdentifierInstanceNameShaderTemplate, False)