[Piglit] [PATCH] arb_compute_shader: Test parsing shared variables
Timothy Arceri
timothy.arceri at collabora.com
Fri Nov 6 19:33:17 PST 2015
On Thu, 2015-11-05 at 16:26 -0800, Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>
> ---
> .../compiler/shared-variables.comp | 44
> ++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
> create mode 100644 tests/spec/arb_compute_shader/compiler/shared
> -variables.comp
>
> diff --git a/tests/spec/arb_compute_shader/compiler/shared-variables.comp
> b/tests/spec/arb_compute_shader/compiler/shared-variables.comp
> new file mode 100644
> index 0000000..cd4a3d2
> --- /dev/null
> +++ b/tests/spec/arb_compute_shader/compiler/shared-variables.comp
> @@ -0,0 +1,44 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 4.20
> +// require_extensions: GL_ARB_compute_shader
> +// [end config]
> +
> +#version 420
> +#extension GL_ARB_compute_shader: enable
> +
> +#define DECL(q, t) q t t##_v; q t t##_va[2]
> +#define DECL_234(q, t) DECL(q, t##2); DECL(q, t##3); DECL(q, t##4)
> +
> +#define DECL_VARS(q) \
> + DECL(q, uint); \
> + DECL(q, int); \
> + DECL(q, float); \
> + DECL_234(q, uvec); \
> + DECL_234(q, ivec); \
> + DECL_234(q, vec); \
> + DECL_234(q, mat)
> +
> +struct s1 {
> + DECL_VARS();
> +};
> +
> +struct s2 {
> + s1 s;
> + s1 sa[2];
> +};
> +
> +DECL_VARS(shared);
> +
> +shared s1 s1i;
> +shared s2 s2i;
> +
> +layout(local_size_x = 1) in;
> +
> +void main()
> +{
> + uint_va[1] = s2i.sa[1].uint_va[1];
> + s1i.mat4_va[1] = mat4_v;
> + s2i.sa[1].vec4_va[0] = s1i.mat4_va[1][3];
> + s2i.s.mat2_va[1][1][0] = float_v;
> +}
More information about the Piglit
mailing list