[Piglit] [PATCH] add basic ARB_shader_group_vote tests

Ilia Mirkin imirkin at alum.mit.edu
Sun May 29 17:43:02 UTC 2016


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 generated_tests/gen_extensions_defined.py        |  1 +
 tests/spec/arb_shader_group_vote/all.shader_test | 27 ++++++++++++++++++++++++
 tests/spec/arb_shader_group_vote/any.shader_test | 27 ++++++++++++++++++++++++
 tests/spec/arb_shader_group_vote/eq.shader_test  | 27 ++++++++++++++++++++++++
 4 files changed, 82 insertions(+)
 create mode 100644 tests/spec/arb_shader_group_vote/all.shader_test
 create mode 100644 tests/spec/arb_shader_group_vote/any.shader_test
 create mode 100644 tests/spec/arb_shader_group_vote/eq.shader_test

diff --git a/generated_tests/gen_extensions_defined.py b/generated_tests/gen_extensions_defined.py
index 7d4ec10..787b429 100644
--- a/generated_tests/gen_extensions_defined.py
+++ b/generated_tests/gen_extensions_defined.py
@@ -108,6 +108,7 @@ EXTENSIONS = [
     ("GL_ARB_geometry_shader4", "110"),
     ("GL_OES_EGL_image_external", "100"),
     ("GL_EXT_shader_samples_identical", "110"),
+    ("GL_ARB_shader_group_vote", "110"),
     ("GL_EXT_shader_samples_identical", "310 es"),
     ("GL_OES_sample_variables", "300 es"),
     ("GL_OES_multisample_interpolation", "300 es"),
diff --git a/tests/spec/arb_shader_group_vote/all.shader_test b/tests/spec/arb_shader_group_vote/all.shader_test
new file mode 100644
index 0000000..176f9ee
--- /dev/null
+++ b/tests/spec/arb_shader_group_vote/all.shader_test
@@ -0,0 +1,27 @@
+[require]
+GL >= 3.2
+GLSL >= 1.50
+GL_ARB_compute_shader
+GL_ARB_shader_atomic_counters
+GL_ARB_shader_group_vote
+
+[compute shader]
+#version 150
+#extension GL_ARB_compute_shader: require
+#extension GL_ARB_shader_atomic_counters: require
+#extension GL_ARB_shader_group_vote: require
+
+layout(binding = 0) uniform atomic_uint inc;
+
+layout(local_size_x = 8) in;
+
+void main()
+{
+  if (allInvocationsARB(bool(gl_WorkGroupID.x)))
+    atomicCounterIncrement(inc);
+}
+
+[test]
+atomic counters 1
+compute 2 1 1
+probe atomic counter 0 == 8
diff --git a/tests/spec/arb_shader_group_vote/any.shader_test b/tests/spec/arb_shader_group_vote/any.shader_test
new file mode 100644
index 0000000..44d2e8e
--- /dev/null
+++ b/tests/spec/arb_shader_group_vote/any.shader_test
@@ -0,0 +1,27 @@
+[require]
+GL >= 3.2
+GLSL >= 1.50
+GL_ARB_compute_shader
+GL_ARB_shader_atomic_counters
+GL_ARB_shader_group_vote
+
+[compute shader]
+#version 150
+#extension GL_ARB_compute_shader: require
+#extension GL_ARB_shader_atomic_counters: require
+#extension GL_ARB_shader_group_vote: require
+
+layout(binding = 0) uniform atomic_uint inc;
+
+layout(local_size_x = 8) in;
+
+void main()
+{
+  if (anyInvocationARB(bool(gl_WorkGroupID.x)))
+    atomicCounterIncrement(inc);
+}
+
+[test]
+atomic counters 1
+compute 2 1 1
+probe atomic counter 0 == 8
diff --git a/tests/spec/arb_shader_group_vote/eq.shader_test b/tests/spec/arb_shader_group_vote/eq.shader_test
new file mode 100644
index 0000000..ca1a136
--- /dev/null
+++ b/tests/spec/arb_shader_group_vote/eq.shader_test
@@ -0,0 +1,27 @@
+[require]
+GL >= 3.2
+GLSL >= 1.50
+GL_ARB_compute_shader
+GL_ARB_shader_atomic_counters
+GL_ARB_shader_group_vote
+
+[compute shader]
+#version 150
+#extension GL_ARB_compute_shader: require
+#extension GL_ARB_shader_atomic_counters: require
+#extension GL_ARB_shader_group_vote: require
+
+layout(binding = 0) uniform atomic_uint inc;
+
+layout(local_size_x = 8) in;
+
+void main()
+{
+  if (allInvocationsEqualARB(bool(gl_WorkGroupID.x)))
+    atomicCounterIncrement(inc);
+}
+
+[test]
+atomic counters 1
+compute 2 1 1
+probe atomic counter 0 == 16
-- 
2.7.3



More information about the Piglit mailing list