diff options
author | Chris Forbes <chrisf@ijw.co.nz> | 2014-10-29 21:27:20 +1300 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2015-07-29 21:43:48 +0200 |
commit | 45a867f1bb79fc650d082197781db0969c85c910 (patch) | |
tree | 6145246b552cd074fa8e778833c93b26628c359a | |
parent | ad9b4e06143952a0060cda19eaed688301065c0c (diff) |
arb_tessellation_shader: add tests for correct set of invocations
These are interesting basic cases for i965, even without per-vertex
outputs.
v2: fixed by Marek
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
-rw-r--r-- | tests/spec/arb_tessellation_shader/execution/invocation-counting-even.shader_test | 60 | ||||
-rw-r--r-- | tests/spec/arb_tessellation_shader/execution/invocation-counting-odd.shader_test | 60 |
2 files changed, 120 insertions, 0 deletions
diff --git a/tests/spec/arb_tessellation_shader/execution/invocation-counting-even.shader_test b/tests/spec/arb_tessellation_shader/execution/invocation-counting-even.shader_test new file mode 100644 index 000000000..005257238 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/execution/invocation-counting-even.shader_test @@ -0,0 +1,60 @@ +# Test that the correct set of invocations is dispatched +# for an even number of output vertices + +[require] +GLSL >= 1.50 +GL_ARB_tessellation_shader +GL_ARB_shader_atomic_counters + +[vertex shader passthrough] + +[tessellation control shader] +#version 150 +#extension GL_ARB_tessellation_shader : require +#extension GL_ARB_shader_atomic_counters : require + +layout(vertices = 4) out; + +layout(binding=0) uniform atomic_uint x; + +void main() +{ + gl_TessLevelInner[0] = 1.0; + gl_TessLevelInner[1] = 1.0; + + gl_TessLevelOuter[0] = 1.0; + gl_TessLevelOuter[1] = 1.0; + gl_TessLevelOuter[2] = 1.0; + gl_TessLevelOuter[3] = 1.0; + + int i; + for (i=0; i<=gl_InvocationID; i++) + atomicCounterIncrement(x); +} + +[tessellation evaluation shader] +#version 150 +#extension GL_ARB_tessellation_shader : require + +layout(quads, equal_spacing) in; + +void main() +{ + gl_Position = vec4(gl_TessCoord.xy * 2 - 1, 0, 1); +} + +[fragment shader] +#version 150 + +void main() +{ + gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); +} + +[test] +atomic counters 1 +patch parameter vertices 1 +draw arrays GL_PATCHES 0 1 + +probe atomic counter 0 == 10 +probe all rgba 0.0 1.0 0.0 1.0 diff --git a/tests/spec/arb_tessellation_shader/execution/invocation-counting-odd.shader_test b/tests/spec/arb_tessellation_shader/execution/invocation-counting-odd.shader_test new file mode 100644 index 000000000..446c8d798 --- /dev/null +++ b/tests/spec/arb_tessellation_shader/execution/invocation-counting-odd.shader_test @@ -0,0 +1,60 @@ +# Test that the correct set of invocations is dispatched +# for an odd number of output vertices + +[require] +GLSL >= 1.50 +GL_ARB_tessellation_shader +GL_ARB_shader_atomic_counters + +[vertex shader passthrough] + +[tessellation control shader] +#version 150 +#extension GL_ARB_tessellation_shader : require +#extension GL_ARB_shader_atomic_counters : require + +layout(vertices = 3) out; + +layout(binding=0) uniform atomic_uint x; + +void main() +{ + gl_TessLevelInner[0] = 1.0; + gl_TessLevelInner[1] = 1.0; + + gl_TessLevelOuter[0] = 1.0; + gl_TessLevelOuter[1] = 1.0; + gl_TessLevelOuter[2] = 1.0; + gl_TessLevelOuter[3] = 1.0; + + int i; + for (i=0; i<=gl_InvocationID; i++) + atomicCounterIncrement(x); +} + +[tessellation evaluation shader] +#version 150 +#extension GL_ARB_tessellation_shader : require + +layout(quads, equal_spacing) in; + +void main() +{ + gl_Position = vec4(gl_TessCoord.xy * 2 - 1, 0, 1); +} + +[fragment shader] +#version 150 + +void main() +{ + gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); +} + +[test] +atomic counters 1 +patch parameter vertices 1 +draw arrays GL_PATCHES 0 1 + +probe atomic counter 0 == 6 +probe all rgba 0.0 1.0 0.0 1.0 |