Mesa (master): st/mesa: add support for dispatching a variable local size
Samuel Pitoiset
hakzsam at kemper.freedesktop.org
Thu Oct 6 22:25:22 UTC 2016
Module: Mesa
Branch: master
Commit: dfd7734cb785268acd914590733dcb5a30e873a1
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dfd7734cb785268acd914590733dcb5a30e873a1
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Tue Sep 6 20:15:00 2016 +0200
st/mesa: add support for dispatching a variable local size
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/mesa/state_tracker/st_cb_compute.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/mesa/state_tracker/st_cb_compute.c b/src/mesa/state_tracker/st_cb_compute.c
index 88c1ee2..ccc5dc2 100644
--- a/src/mesa/state_tracker/st_cb_compute.c
+++ b/src/mesa/state_tracker/st_cb_compute.c
@@ -36,6 +36,7 @@
static void st_dispatch_compute_common(struct gl_context *ctx,
const GLuint *num_groups,
+ const GLuint *group_size,
struct pipe_resource *indirect,
GLintptr indirect_offset)
{
@@ -56,7 +57,7 @@ static void st_dispatch_compute_common(struct gl_context *ctx,
st_validate_state(st, ST_PIPELINE_COMPUTE);
for (unsigned i = 0; i < 3; i++) {
- info.block[i] = prog->Comp.LocalSize[i];
+ info.block[i] = group_size ? group_size[i] : prog->Comp.LocalSize[i];
info.grid[i] = num_groups ? num_groups[i] : 0;
}
@@ -71,7 +72,7 @@ static void st_dispatch_compute_common(struct gl_context *ctx,
static void st_dispatch_compute(struct gl_context *ctx,
const GLuint *num_groups)
{
- st_dispatch_compute_common(ctx, num_groups, NULL, 0);
+ st_dispatch_compute_common(ctx, num_groups, NULL, NULL, 0);
}
static void st_dispatch_compute_indirect(struct gl_context *ctx,
@@ -80,11 +81,19 @@ static void st_dispatch_compute_indirect(struct gl_context *ctx,
struct gl_buffer_object *indirect_buffer = ctx->DispatchIndirectBuffer;
struct pipe_resource *indirect = st_buffer_object(indirect_buffer)->buffer;
- st_dispatch_compute_common(ctx, NULL, indirect, indirect_offset);
+ st_dispatch_compute_common(ctx, NULL, NULL, indirect, indirect_offset);
+}
+
+static void st_dispatch_compute_group_size(struct gl_context *ctx,
+ const GLuint *num_groups,
+ const GLuint *group_size)
+{
+ st_dispatch_compute_common(ctx, num_groups, group_size, NULL, 0);
}
void st_init_compute_functions(struct dd_function_table *functions)
{
functions->DispatchCompute = st_dispatch_compute;
functions->DispatchComputeIndirect = st_dispatch_compute_indirect;
+ functions->DispatchComputeGroupSize = st_dispatch_compute_group_size;
}
More information about the mesa-commit
mailing list