diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2018-10-05 20:57:15 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2018-10-08 14:27:04 -0400 |
commit | 4e2e36ee019e50b5f386974dc2cf02fad83a1a8f (patch) | |
tree | 0bf9c8f235353b3b01bf64085dcef2664be826bc | |
parent | 72e1c3dbf26002bfc547f58ec248f9853e75bac3 (diff) | |
download | piglit-4e2e36ee019e50b5f386974dc2cf02fad83a1a8f.tar.gz |
glsl-1.10: add tests for an array index on a swizzled vec lvalue
Current mesa fails both of these (in different ways!).
Inspired by WebGL conformance test
conformance2/glsl3/vector-dynamic-indexing-swizzled-lvalue.html
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
-rw-r--r-- | tests/spec/glsl-1.10/execution/swizzled-writemask-indexing-nonconst.shader_test | 17 | ||||
-rw-r--r-- | tests/spec/glsl-1.10/execution/swizzled-writemask-indexing.shader_test | 15 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.10/execution/swizzled-writemask-indexing-nonconst.shader_test b/tests/spec/glsl-1.10/execution/swizzled-writemask-indexing-nonconst.shader_test new file mode 100644 index 000000000..fa1f7df58 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/swizzled-writemask-indexing-nonconst.shader_test @@ -0,0 +1,17 @@ +[require] +GLSL >= 1.10 + +[vertex shader passthrough] + +[fragment shader] +uniform int zero; +void main() { + gl_FragColor = vec4(1, 0, 0, 1); + gl_FragColor.wzyx[zero + 2] = 1.0; + gl_FragColor.wzyx[zero + 3] = 0.0; +} + +[test] +uniform int zero 0 +draw rect -1 -1 2 2 +probe all rgba 0 1 0 1 diff --git a/tests/spec/glsl-1.10/execution/swizzled-writemask-indexing.shader_test b/tests/spec/glsl-1.10/execution/swizzled-writemask-indexing.shader_test new file mode 100644 index 000000000..f61ebabb8 --- /dev/null +++ b/tests/spec/glsl-1.10/execution/swizzled-writemask-indexing.shader_test @@ -0,0 +1,15 @@ +[require] +GLSL >= 1.10 + +[vertex shader passthrough] + +[fragment shader] +void main() { + gl_FragColor = vec4(1, 0, 0, 1); + gl_FragColor.wzyx[2] = 1.0; + gl_FragColor.wzyx[3] = 0.0; +} + +[test] +draw rect -1 -1 2 2 +probe all rgba 0 1 0 1 |