On 10.09.2016 17:19, Samuel Pitoiset wrote:
This allows to dispatch compute shaders with a variable local size
using the new "compute group size" command.

Signed-off-by: Samuel Pitoiset <[email protected]>
---
 tests/shaders/shader_runner.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 8e29346..e9d39e9 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2924,6 +2924,13 @@ piglit_display(void)
                        glMemoryBarrier(GL_ALL_BARRIER_BITS);
                        glDispatchCompute(x, y, z);
                        glMemoryBarrier(GL_ALL_BARRIER_BITS);
+               } else if (sscanf(line,
+                                 "compute group size %d %d %d %d %d %d",
+                                 &x, &y, &z, &w, &h, &l) == 6) {
+                       program_must_be_in_use();
+                       glMemoryBarrier(GL_ALL_BARRIER_BITS);
+                       glDispatchComputeGroupSizeARB(x, y, z, w, h, l);
+                       glMemoryBarrier(GL_ALL_BARRIER_BITS);

FWIW, I don't particularly like that the memory barriers are added unconditionally, because it prevents us from writing tests that test specific bits, but since the other compute call also does this, I think it's okay.

Nicolai

                } else if (string_match("draw rect tex", line)) {
                        program_must_be_in_use();
                        program_subroutine_uniforms();

_______________________________________________
Piglit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to