diff options
-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 |