The ARB_compute_shader spec says:

  "If the work group count in any dimension is zero, no work groups
   are dispatched."

Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com>
---
 tests/spec/arb_compute_shader/cs-ids-common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_compute_shader/cs-ids-common.c 
b/tests/spec/arb_compute_shader/cs-ids-common.c
index 9676c82..e5987d3 100644
--- a/tests/spec/arb_compute_shader/cs-ids-common.c
+++ b/tests/spec/arb_compute_shader/cs-ids-common.c
@@ -135,7 +135,8 @@ confirm_size()
 
        memset(&values, 0, sizeof values);
 
-       for (z = 0; z < zs; z++) {
+       const bool no_work = global_x == 0 || global_y == 0 || global_z == 0;
+       for (z = 0; z < zs && !no_work; z++) {
                for (y = 0; y < ys; y++) {
                        for (x = 0; x < xs; x++) {
                                if (((x & y) & z) == 0u)
@@ -280,8 +281,7 @@ cs_ids_run_test()
                       local_x, local_y, local_z,
                       global_x, global_y, global_z);
 
-       if (local_x == 0 || local_y == 0 || local_z == 0 ||
-           global_x == 0 || global_y == 0 || global_z == 0)
+       if (local_x == 0 || local_y == 0 || local_z == 0)
                return PIGLIT_FAIL;
 
        glBindBufferBase(GL_ATOMIC_COUNTER_BUFFER, 0, atomics_bo);
-- 
2.7.0

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to