[Piglit] [PATCH 3/3] arb_compute_shader: shared variable atomic functions compiler tests

Jordan Justen jordan.l.justen at intel.com
Thu Nov 5 10:50:06 PST 2015


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 .../compiler/shared-atomics.comp                   | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 tests/spec/arb_compute_shader/compiler/shared-atomics.comp

diff --git a/tests/spec/arb_compute_shader/compiler/shared-atomics.comp b/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
new file mode 100644
index 0000000..c144206
--- /dev/null
+++ b/tests/spec/arb_compute_shader/compiler/shared-atomics.comp
@@ -0,0 +1,40 @@
+// [config]
+// expect_result: pass
+// glsl_version: 3.30
+// require_extensions: GL_ARB_compute_shader
+// [end config]
+
+#version 330
+#extension GL_ARB_compute_shader: enable
+
+shared uint u;
+shared int i;
+
+layout(local_size_x = 1) in;
+
+void main()
+{
+    atomicAdd(u, 1u);
+    atomicAdd(i, 1);
+
+    atomicMin(u, 1u);
+    atomicMin(i, 1);
+
+    atomicMax(u, 1u);
+    atomicMax(i, 1);
+
+    atomicAnd(u, 1u);
+    atomicAnd(i, 1);
+
+    atomicOr(u, 1u);
+    atomicOr(i, 1);
+
+    atomicXor(u, 1u);
+    atomicXor(i, 1);
+
+    atomicExchange(u, 1u);
+    atomicExchange(i, 1);
+
+    atomicCompSwap(u, 1u, 2u);
+    atomicCompSwap(i, 1, 2);
+}
-- 
2.6.2



More information about the Piglit mailing list