diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2012-11-16 16:24:29 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2012-11-26 14:21:50 -0800 |
commit | a1515bd2c785bac4d0f08e9f09fec1eba7321d7c (patch) | |
tree | 3641f9761ae3f69db777d703ce75c550065383fc | |
parent | cdb79aa2576e5221487ddfe1cf529742887143e9 (diff) |
glsl-es-3.00: Verify that .length() returns a signed integer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
3 files changed, 81 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-3.00/compiler/array-length-is-not-float.vert b/tests/spec/glsl-es-3.00/compiler/array-length-is-not-float.vert new file mode 100644 index 00000000..d5299853 --- /dev/null +++ b/tests/spec/glsl-es-3.00/compiler/array-length-is-not-float.vert @@ -0,0 +1,27 @@ +#version 300 es + +/* [config] + * expect_result: fail + * glsl_version: 3.00 + * [end config] + * + * Page 35 of the OpenGL ES Shading Language 3.00 spec says: + * + * "Arrays have a fixed number of elements. This can be obtained + * by using the length method: + * + * a.length(); + * // returns 5 for the above declarations + * + * The return value is a constant signed integral expression. The + * precision is determined using the same rules as for literal + * integers." + */ + +uniform vec4 a[7]; +uniform int i; + +void main() +{ + gl_Position = vec4(a[i].x + a.length()); +} diff --git a/tests/spec/glsl-es-3.00/compiler/array-length-is-not-unsigned-int.vert b/tests/spec/glsl-es-3.00/compiler/array-length-is-not-unsigned-int.vert new file mode 100644 index 00000000..56be010e --- /dev/null +++ b/tests/spec/glsl-es-3.00/compiler/array-length-is-not-unsigned-int.vert @@ -0,0 +1,27 @@ +#version 300 es + +/* [config] + * expect_result: fail + * glsl_version: 3.00 + * [end config] + * + * Page 35 of the OpenGL ES Shading Language 3.00 spec says: + * + * "Arrays have a fixed number of elements. This can be obtained + * by using the length method: + * + * a.length(); + * // returns 5 for the above declarations + * + * The return value is a constant signed integral expression. The + * precision is determined using the same rules as for literal + * integers." + */ + +uniform vec4 a[7]; +uniform int i; + +void main() +{ + gl_Position = vec4(uint(a[i].x) + a.length()); +} diff --git a/tests/spec/glsl-es-3.00/compiler/array-length-is-signed-int.vert b/tests/spec/glsl-es-3.00/compiler/array-length-is-signed-int.vert new file mode 100644 index 00000000..4dee5e8a --- /dev/null +++ b/tests/spec/glsl-es-3.00/compiler/array-length-is-signed-int.vert @@ -0,0 +1,27 @@ +#version 300 es + +/* [config] + * expect_result: pass + * glsl_version: 3.00 + * [end config] + * + * Page 35 of the OpenGL ES Shading Language 3.00 spec says: + * + * "Arrays have a fixed number of elements. This can be obtained + * by using the length method: + * + * a.length(); + * // returns 5 for the above declarations + * + * The return value is a constant signed integral expression. The + * precision is determined using the same rules as for literal + * integers." + */ + +uniform vec4 a[7]; +uniform int i; + +void main() +{ + gl_Position = vec4(int(a[i].x) + a.length()); +} |