diff options
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_compute.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 12 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.h | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_compute.c b/src/gallium/drivers/panfrost/pan_compute.c index 78f3a885073..5ca63c15929 100644 --- a/src/gallium/drivers/panfrost/pan_compute.c +++ b/src/gallium/drivers/panfrost/pan_compute.c @@ -87,6 +87,8 @@ panfrost_launch_grid(struct pipe_context *pipe, { struct panfrost_context *ctx = pan_context(pipe); + ctx->compute_grid = info; + struct mali_job_descriptor_header job = { .job_type = JOB_TYPE_COMPUTE, .job_descriptor_size = 1, diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 035ce52128b..409c852a228 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -749,6 +749,14 @@ static void panfrost_upload_ssbo_sysval( uniform->u[2] = sb.buffer_size; } +static void panfrost_upload_num_work_groups_sysval(struct panfrost_context *ctx, + struct sysval_uniform *uniform) +{ + uniform->u[0] = ctx->compute_grid->grid[0]; + uniform->u[1] = ctx->compute_grid->grid[1]; + uniform->u[2] = ctx->compute_grid->grid[2]; +} + static void panfrost_upload_sysvals(struct panfrost_context *ctx, void *buf, struct panfrost_shader_state *ss, enum pipe_shader_type st) @@ -773,6 +781,10 @@ static void panfrost_upload_sysvals(struct panfrost_context *ctx, void *buf, panfrost_upload_ssbo_sysval(ctx, st, PAN_SYSVAL_ID(sysval), &uniforms[i]); break; + case PAN_SYSVAL_NUM_WORK_GROUPS: + panfrost_upload_num_work_groups_sysval(ctx, &uniforms[i]); + break; + default: assert(0); } diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h index 542d24d2c27..1277629382a 100644 --- a/src/gallium/drivers/panfrost/pan_context.h +++ b/src/gallium/drivers/panfrost/pan_context.h @@ -108,6 +108,9 @@ struct panfrost_context { /* panfrost_resource -> panfrost_job */ struct hash_table *write_jobs; + /* Within a launch_grid call.. */ + const struct pipe_grid_info *compute_grid; + /* Bit mask for supported PIPE_DRAW for this hardware */ unsigned draw_modes; |