[Mesa-dev] [PATCH 10/11] st/mesa: expose ARB_compute_variable_group_size

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Sep 8 20:31:33 UTC 2016


This extension is only exposed if the underlying driver supports
ARB_compute_shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mesa/state_tracker/st_extensions.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 807fbfb..dc2e60a 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -1196,6 +1196,19 @@ void st_init_extensions(struct pipe_screen *screen,
          extensions->ARB_compute_shader =
                                       extensions->ARB_shader_image_load_store &&
                                       extensions->ARB_shader_atomic_counters;
+
+         if (extensions->ARB_compute_shader) {
+            /* Because the minimum values required by
+             * ARB_compute_variable_group_size are less (or equal) than the
+             * ones defined by ARB_compute_shader we can re-use them. */
+            for (i = 0; i < 3; i++) {
+               consts->MaxComputeVariableGroupSize[i] =
+                  consts->MaxComputeWorkGroupSize[i];
+            }
+            consts->MaxComputeVariableGroupInvocations =
+               consts->MaxComputeWorkGroupInvocations;
+            extensions->ARB_compute_variable_group_size = true;
+         }
       }
    }
 
-- 
2.9.3



More information about the mesa-dev mailing list