From fa5239c1534a6ce5bf85602dddddba6df6d67724 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Fri, 2 Feb 2018 10:08:52 +1100 Subject: ac/radeonsi: add workgroup_ids to the abi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_shader.c | 9 ++++----- src/gallium/drivers/radeonsi/si_shader_internal.h | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 1294af30128..c421d4405e0 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2152,9 +2152,8 @@ void si_load_system_value(struct si_shader_context *ctx, for (int i = 0; i < 3; i++) { values[i] = ctx->i32_0; - if (ctx->param_block_id[i] >= 0) { - values[i] = LLVMGetParam(ctx->main_fn, - ctx->param_block_id[i]); + if (ctx->abi.workgroup_ids[i]) { + values[i] = ctx->abi.workgroup_ids[i]; } } value = lp_build_gather_values(&ctx->gallivm, values, 3); @@ -4882,9 +4881,9 @@ static void create_function(struct si_shader_context *ctx) ctx->param_block_size = add_arg(&fninfo, ARG_SGPR, v3i32); for (i = 0; i < 3; i++) { - ctx->param_block_id[i] = -1; + ctx->abi.workgroup_ids[i] = NULL; if (shader->selector->info.uses_block_id[i]) - ctx->param_block_id[i] = add_arg(&fninfo, ARG_SGPR, ctx->i32); + add_arg_assign(&fninfo, ARG_SGPR, ctx->i32, &ctx->abi.workgroup_ids[i]); } ctx->param_thread_id = add_arg(&fninfo, ARG_VGPR, v3i32); diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h index 00b9b8d16a5..20618cb936f 100644 --- a/src/gallium/drivers/radeonsi/si_shader_internal.h +++ b/src/gallium/drivers/radeonsi/si_shader_internal.h @@ -186,7 +186,6 @@ struct si_shader_context { /* CS */ int param_grid_size; int param_block_size; - int param_block_id[3]; int param_thread_id; LLVMTargetMachineRef tm; -- cgit v1.2.3