LLVMValueRef ring_offsets;
LLVMValueRef push_constants;
LLVMValueRef view_index;
- LLVMValueRef num_work_groups;
LLVMValueRef tg_size;
LLVMValueRef vertex_buffers;
if (ctx->shader_info->info.cs.uses_grid_size) {
add_arg(&args, ARG_SGPR, ctx->ac.v3i32,
- &ctx->num_work_groups);
+ &ctx->abi.num_work_groups);
}
for (int i = 0; i < 3; i++) {
result = ctx->abi->instance_id;
break;
case nir_intrinsic_load_num_work_groups:
- result = ctx->nctx->num_work_groups;
+ result = ctx->abi->num_work_groups;
break;
case nir_intrinsic_load_local_invocation_index:
result = visit_load_local_invocation_index(ctx->nctx);
LLVMValueRef prim_mask;
/* CS */
LLVMValueRef local_invocation_ids;
+ LLVMValueRef num_work_groups;
LLVMValueRef workgroup_ids[3];
/* For VS and PS: pre-loaded shader inputs.
break;
case TGSI_SEMANTIC_GRID_SIZE:
- value = LLVMGetParam(ctx->main_fn, ctx->param_grid_size);
+ value = ctx->abi.num_work_groups;
break;
case TGSI_SEMANTIC_BLOCK_SIZE:
declare_global_desc_pointers(ctx, &fninfo);
declare_per_stage_desc_pointers(ctx, &fninfo, true);
if (shader->selector->info.uses_grid_size)
- ctx->param_grid_size = add_arg(&fninfo, ARG_SGPR, v3i32);
+ add_arg_assign(&fninfo, ARG_SGPR, v3i32, &ctx->abi.num_work_groups);
if (shader->selector->info.uses_block_size)
ctx->param_block_size = add_arg(&fninfo, ARG_SGPR, v3i32);
int param_gs_vtx23_offset; /* in dwords (GFX9) */
int param_gs_vtx45_offset; /* in dwords (GFX9) */
/* CS */
- int param_grid_size;
int param_block_size;
LLVMTargetMachineRef tm;