[Piglit] [PATCH 3/3] arb_compute_shader: Add simple compute shader with atomic counters

Jordan Justen jordan.l.justen at intel.com
Sat Jun 7 11:59:00 PDT 2014


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 .../execution/atomic-counter.shader_test           | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 tests/spec/arb_compute_shader/execution/atomic-counter.shader_test

diff --git a/tests/spec/arb_compute_shader/execution/atomic-counter.shader_test b/tests/spec/arb_compute_shader/execution/atomic-counter.shader_test
new file mode 100644
index 0000000..f287989
--- /dev/null
+++ b/tests/spec/arb_compute_shader/execution/atomic-counter.shader_test
@@ -0,0 +1,29 @@
+# A simple compute shader using atomic counters
+
+[require]
+GL >= 3.2
+GLSL >= 1.50
+GL_ARB_compute_shader
+GL_ARB_shader_atomic_counters
+
+[compute shader]
+#version 150
+#extension GL_ARB_compute_shader: require
+#extension GL_ARB_shader_atomic_counters: require
+
+layout(binding = 0) uniform atomic_uint inc;
+layout(binding = 0) uniform atomic_uint dec;
+
+layout(local_size_x = 8, local_size_y = 8, local_size_z = 8) in;
+
+void main()
+{
+	atomicCounterIncrement(inc);
+	atomicCounterDecrement(dec);
+}
+
+[test]
+atomic counters 2
+compute 1 1 1
+probe atomic counter ( 0 ) == 512
+probe atomic counter ( 1 ) == 4294966784
-- 
2.0.0.rc4



More information about the Piglit mailing list