From: Mika Isojärvi Date: Fri, 17 Apr 2015 00:40:49 +0000 (-0700) Subject: Add more negative GLSL ES 3 uniform block tests. X-Git-Tag: upstream/0.1.0~1761^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=365a35eb0f114809f4cc1822b688f6e301f50acb;p=platform%2Fupstream%2FVK-GL-CTS.git Add more negative GLSL ES 3 uniform block tests. Add new tests that test more invalid identifiers. Change-Id: I138283623a98c980790e392b64d434dab33f51d4 --- diff --git a/android/cts/master/com.drawelements.deqp.gles3.xml b/android/cts/master/com.drawelements.deqp.gles3.xml index 4acc4068b..7cccbe22a 100644 --- a/android/cts/master/com.drawelements.deqp.gles3.xml +++ b/android/cts/master/com.drawelements.deqp.gles3.xml @@ -14197,10 +14197,22 @@ - + - + + + + + + + + + + + + + @@ -14215,10 +14227,22 @@ - + + + + + + + + + + + + + - + diff --git a/android/cts/master/gles3-master.txt b/android/cts/master/gles3-master.txt index 48b9ad7f3..f7490c27c 100644 --- a/android/cts/master/gles3-master.txt +++ b/android/cts/master/gles3-master.txt @@ -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 diff --git a/data/gles3/shaders/uniform_block.test b/data/gles3/shaders/uniform_block.test index c5f6751ff..2a4540099 100644 --- a/data/gles3/shaders/uniform_block.test +++ b/data/gles3/shaders/uniform_block.test @@ -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 diff --git a/modules/gles3/scripts/gen-uniform-blocks.py b/modules/gles3/scripts/gen-uniform-blocks.py index 535321317..24a4e8bcc 100644 --- a/modules/gles3/scripts/gen-uniform-blocks.py +++ b/modules/gles3/scripts/gen-uniform-blocks.py @@ -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)