[Piglit] [PATCH] arb_compute_shader: Test parsing shared variables
Jordan Justen
jordan.l.justen at intel.com
Thu Nov 5 16:26:15 PST 2015
Signed-off-by: Jordan Justen <jordan.l.justen at intel.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;
+}
--
2.6.2
More information about the Piglit
mailing list