[Piglit] [PATCH] arb_compute_variable_group_size: check gl_GlobalInvocationID
Nicolai Hähnle
nhaehnle at gmail.com
Sun Oct 22 18:23:55 UTC 2017
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
On 21.10.2017 21:21, Ilia Mirkin wrote:
> An implementation bug in mesa caused these values to be computed
> incorrectly. Make sure that they work as defined.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> .../execution/global-invocation-id.shader_test | 44 ++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
> create mode 100644 tests/spec/arb_compute_variable_group_size/execution/global-invocation-id.shader_test
>
> diff --git a/tests/spec/arb_compute_variable_group_size/execution/global-invocation-id.shader_test b/tests/spec/arb_compute_variable_group_size/execution/global-invocation-id.shader_test
> new file mode 100644
> index 000000000..24f2f1d05
> --- /dev/null
> +++ b/tests/spec/arb_compute_variable_group_size/execution/global-invocation-id.shader_test
> @@ -0,0 +1,44 @@
> +# Simple test that verifies gl_GlobalInvocationID derived values are
> +# computed properly.
> +
> +[require]
> +GL >= 3.3
> +GLSL >= 3.30
> +GL_ARB_compute_shader
> +GL_ARB_compute_variable_group_size
> +GL_ARB_shader_storage_buffer_object
> +
> +[compute shader]
> +#version 330
> +#extension GL_ARB_compute_shader: require
> +#extension GL_ARB_compute_variable_group_size: require
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(local_size_variable) in;
> +
> +layout(std430)
> +buffer SSBO {
> + uvec2 id[4];
> +};
> +
> +void main()
> +{
> + uint g = gl_GlobalInvocationID.x;
> + uint l = gl_LocalInvocationID.x;
> + uint t = gl_WorkGroupID.x * gl_LocalGroupSizeARB.x + gl_LocalInvocationID.x;
> + id[t] = uvec2(g, l);
> +}
> +
> +[test]
> +ssbo 0 32
> +
> +compute group size 2 1 1 2 1 1
> +
> +probe ssbo uint 0 0 == 0
> +probe ssbo uint 0 4 == 0
> +probe ssbo uint 0 8 == 1
> +probe ssbo uint 0 12 == 1
> +probe ssbo uint 0 16 == 2
> +probe ssbo uint 0 20 == 0
> +probe ssbo uint 0 24 == 3
> +probe ssbo uint 0 28 == 1
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the Piglit
mailing list