ac/radeonsi: add local_invocation_ids to the abi
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
@@ -91,7 +91,6 @@ struct nir_to_llvm_context {
|
|||||||
LLVMValueRef push_constants;
|
LLVMValueRef push_constants;
|
||||||
LLVMValueRef view_index;
|
LLVMValueRef view_index;
|
||||||
LLVMValueRef num_work_groups;
|
LLVMValueRef num_work_groups;
|
||||||
LLVMValueRef local_invocation_ids;
|
|
||||||
LLVMValueRef tg_size;
|
LLVMValueRef tg_size;
|
||||||
|
|
||||||
LLVMValueRef vertex_buffers;
|
LLVMValueRef vertex_buffers;
|
||||||
@@ -795,7 +794,7 @@ static void create_function(struct nir_to_llvm_context *ctx,
|
|||||||
if (ctx->shader_info->info.cs.uses_local_invocation_idx)
|
if (ctx->shader_info->info.cs.uses_local_invocation_idx)
|
||||||
add_arg(&args, ARG_SGPR, ctx->ac.i32, &ctx->tg_size);
|
add_arg(&args, ARG_SGPR, ctx->ac.i32, &ctx->tg_size);
|
||||||
add_arg(&args, ARG_VGPR, ctx->ac.v3i32,
|
add_arg(&args, ARG_VGPR, ctx->ac.v3i32,
|
||||||
&ctx->local_invocation_ids);
|
&ctx->abi.local_invocation_ids);
|
||||||
break;
|
break;
|
||||||
case MESA_SHADER_VERTEX:
|
case MESA_SHADER_VERTEX:
|
||||||
declare_global_input_sgprs(ctx, stage, has_previous_stage,
|
declare_global_input_sgprs(ctx, stage, has_previous_stage,
|
||||||
@@ -4314,7 +4313,7 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case nir_intrinsic_load_local_invocation_id: {
|
case nir_intrinsic_load_local_invocation_id: {
|
||||||
result = ctx->nctx->local_invocation_ids;
|
result = ctx->abi->local_invocation_ids;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case nir_intrinsic_load_base_instance:
|
case nir_intrinsic_load_base_instance:
|
||||||
|
@@ -54,6 +54,8 @@ struct ac_shader_abi {
|
|||||||
LLVMValueRef ancillary;
|
LLVMValueRef ancillary;
|
||||||
LLVMValueRef sample_coverage;
|
LLVMValueRef sample_coverage;
|
||||||
LLVMValueRef prim_mask;
|
LLVMValueRef prim_mask;
|
||||||
|
/* CS */
|
||||||
|
LLVMValueRef local_invocation_ids;
|
||||||
LLVMValueRef workgroup_ids[3];
|
LLVMValueRef workgroup_ids[3];
|
||||||
|
|
||||||
/* For VS and PS: pre-loaded shader inputs.
|
/* For VS and PS: pre-loaded shader inputs.
|
||||||
|
@@ -2161,7 +2161,7 @@ void si_load_system_value(struct si_shader_context *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
case TGSI_SEMANTIC_THREAD_ID:
|
case TGSI_SEMANTIC_THREAD_ID:
|
||||||
value = LLVMGetParam(ctx->main_fn, ctx->param_thread_id);
|
value = ctx->abi.local_invocation_ids;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TGSI_SEMANTIC_HELPER_INVOCATION:
|
case TGSI_SEMANTIC_HELPER_INVOCATION:
|
||||||
@@ -4886,7 +4886,7 @@ static void create_function(struct si_shader_context *ctx)
|
|||||||
add_arg_assign(&fninfo, ARG_SGPR, ctx->i32, &ctx->abi.workgroup_ids[i]);
|
add_arg_assign(&fninfo, ARG_SGPR, ctx->i32, &ctx->abi.workgroup_ids[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->param_thread_id = add_arg(&fninfo, ARG_VGPR, v3i32);
|
add_arg_assign(&fninfo, ARG_VGPR, v3i32, &ctx->abi.local_invocation_ids);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0 && "unimplemented shader");
|
assert(0 && "unimplemented shader");
|
||||||
|
@@ -186,7 +186,6 @@ struct si_shader_context {
|
|||||||
/* CS */
|
/* CS */
|
||||||
int param_grid_size;
|
int param_grid_size;
|
||||||
int param_block_size;
|
int param_block_size;
|
||||||
int param_thread_id;
|
|
||||||
|
|
||||||
LLVMTargetMachineRef tm;
|
LLVMTargetMachineRef tm;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user