[Piglit] [PATCH 1/4] cs: Add simple uniform test with outputs in atomic counters
Jordan Justen
jordan.l.justen at intel.com
Sat Nov 22 11:53:12 PST 2014
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
.../basic-uniform-access-atomic.shader_test | 56 ++++++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 tests/spec/arb_compute_shader/execution/basic-uniform-access-atomic.shader_test
diff --git a/tests/spec/arb_compute_shader/execution/basic-uniform-access-atomic.shader_test b/tests/spec/arb_compute_shader/execution/basic-uniform-access-atomic.shader_test
new file mode 100644
index 0000000..f34316e
--- /dev/null
+++ b/tests/spec/arb_compute_shader/execution/basic-uniform-access-atomic.shader_test
@@ -0,0 +1,56 @@
+# Verify simple reading of a uniform and output to an atomic counter
+
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_compute_shader
+GL_ARB_shader_atomic_counters
+
+[compute shader]
+#version 330
+#extension GL_ARB_compute_shader: enable
+#extension GL_ARB_shader_atomic_counters: require
+
+layout(binding = 0) uniform atomic_uint atomic1;
+layout(binding = 0) uniform atomic_uint atomic2;
+
+uniform uint atomic_num;
+
+layout(local_size_x = 16, local_size_y = 16) in;
+
+void main()
+{
+ if (atomic_num == 1u) {
+ atomicCounterIncrement(atomic1);
+ } else if (atomic_num == 2u) {
+ atomicCounterIncrement(atomic2);
+ }
+}
+
+[test]
+atomic counters 2
+
+uniform uint atomic_num 0
+compute 1 1 1
+probe atomic counter 0 == 0
+probe atomic counter 1 == 0
+
+uniform uint atomic_num 1
+compute 1 1 1
+probe atomic counter 0 == 256
+probe atomic counter 1 == 0
+
+uniform uint atomic_num 2
+compute 2 1 1
+probe atomic counter 0 == 256
+probe atomic counter 1 == 512
+
+uniform uint atomic_num 3
+compute 1 1 1
+probe atomic counter 0 == 256
+probe atomic counter 1 == 512
+
+uniform uint atomic_num 1
+compute 1 1 1
+probe atomic counter 0 == 512
+probe atomic counter 1 == 512
--
2.1.1
More information about the Piglit
mailing list