diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2021-01-16 02:12:44 -0500 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2021-01-16 13:06:04 -0500 |
commit | dca9fa2cef207bd6d86a9236b0da162fa910d85f (patch) | |
tree | 9bdfa7aab576389cff9c6d224f72fe77ce1cf53c | |
parent | fcd916924849bdf746e3a58e428fcce19d8c6262 (diff) |
arb_gpu_shader_int64: add some tests for up-conversions
These (previously) had issues in glsl_to_tgsi. Add tests to demonstrate
the issue as well as prevent it from recurring.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/457>
3 files changed, 79 insertions, 0 deletions
diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-conversion-b2i64.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-conversion-b2i64.shader_test new file mode 100644 index 000000000..6f26f4a63 --- /dev/null +++ b/tests/spec/arb_gpu_shader_int64/execution/fs-conversion-b2i64.shader_test @@ -0,0 +1,25 @@ +[require] +GL >= 4.0 +GLSL >= 4.00 +GL_ARB_gpu_shader_int64 + +[vertex shader passthrough] + +[fragment shader] +#version 400 +#extension GL_ARB_gpu_shader_int64 : require + +out vec4 color; + +void main() +{ + int64_t t = int64_t(gl_FrontFacing); + color = t == 1L ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-conversion-u2i64.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-conversion-u2i64.shader_test new file mode 100644 index 000000000..b32b6c59c --- /dev/null +++ b/tests/spec/arb_gpu_shader_int64/execution/fs-conversion-u2i64.shader_test @@ -0,0 +1,27 @@ +[require] +GL >= 4.0 +GLSL >= 4.00 +GL_ARB_gpu_shader_int64 + +[vertex shader passthrough] + +[fragment shader] +#version 400 +#extension GL_ARB_gpu_shader_int64 : require + +out vec4 color; + +uniform uint val = 1; + +void main() +{ + int64_t t = int64_t(val); + color = t == 1L ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-conversion-u2u64.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-conversion-u2u64.shader_test new file mode 100644 index 000000000..695f01c82 --- /dev/null +++ b/tests/spec/arb_gpu_shader_int64/execution/fs-conversion-u2u64.shader_test @@ -0,0 +1,27 @@ +[require] +GL >= 4.0 +GLSL >= 4.00 +GL_ARB_gpu_shader_int64 + +[vertex shader passthrough] + +[fragment shader] +#version 400 +#extension GL_ARB_gpu_shader_int64 : require + +out vec4 color; + +uniform uint val = 1; + +void main() +{ + uint64_t t = val; + color = t == 1L ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1); +} + +[test] +clear color 0.5 0.5 0.5 0.5 +clear + +draw rect -1 -1 2 2 +probe all rgba 0.0 1.0 0.0 1.0 |