diff options
author | Pavel Ondračka <pavel.ondracka@gmail.com> | 2022-05-10 21:25:32 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-06-15 13:56:46 +0000 |
commit | e50a4eccc80611c3cf260019ab6e545b47cf3406 (patch) | |
tree | 31a84e403787f7f618ecbd9856db782595f2e933 | |
parent | 1d5899d94546ec83941c92f2e08258de0f98e392 (diff) |
glsl-1.10: add simple loop unrolling test with loop counter in vec4
This tests whether the loop will unroll if one component of vec4 is
used as a loop counter. Similar code can be produced by running C&C3
Tiberium Wars under nine with non-integer hardware and than going
through ttn.
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/673>
-rw-r--r-- | tests/spec/glsl-1.10/execution/loops/glsl-fs-loop-vec4-counter.shader_test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.10/execution/loops/glsl-fs-loop-vec4-counter.shader_test b/tests/spec/glsl-1.10/execution/loops/glsl-fs-loop-vec4-counter.shader_test new file mode 100644 index 000000000..edb2a80cd --- /dev/null +++ b/tests/spec/glsl-1.10/execution/loops/glsl-fs-loop-vec4-counter.shader_test @@ -0,0 +1,20 @@ +[require] +GLSL >= 1.10 + +[vertex shader passthrough] + +[fragment shader] +vec4 color; +void main() +{ + color = vec4(0.0, 0.0, 0.0, 0.0); + while (color.y < 0.5) + { + color.y = color.y + 1.0; + } + gl_FragColor = color; +} + +[test] +draw rect -1 -1 2 2 +probe rgba 1 1 0.0 1.0 0.0 0.0 |