mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-31 09:28:19 +02:00
radv: do not load the local invocation index when it's unused
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
2294d35b24
commit
90c3bf0789
4 changed files with 7 additions and 2 deletions
|
|
@ -751,7 +751,8 @@ static void create_function(struct nir_to_llvm_context *ctx,
|
|||
&ctx->num_work_groups);
|
||||
}
|
||||
add_sgpr_argument(&args, ctx->ac.v3i32, &ctx->workgroup_ids);
|
||||
add_sgpr_argument(&args, ctx->ac.i32, &ctx->tg_size);
|
||||
if (ctx->shader_info->info.cs.uses_local_invocation_idx)
|
||||
add_sgpr_argument(&args, ctx->ac.i32, &ctx->tg_size);
|
||||
add_vgpr_argument(&args, ctx->ac.v3i32, &ctx->local_invocation_ids);
|
||||
break;
|
||||
case MESA_SHADER_VERTEX:
|
||||
|
|
|
|||
|
|
@ -58,6 +58,9 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, struct ac_shader_info *info)
|
|||
}
|
||||
break;
|
||||
}
|
||||
case nir_intrinsic_load_local_invocation_index:
|
||||
info->cs.uses_local_invocation_idx = true;
|
||||
break;
|
||||
case nir_intrinsic_load_sample_id:
|
||||
info->ps.force_persample = true;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ struct ac_shader_info {
|
|||
bool uses_grid_size;
|
||||
bool uses_block_id[3];
|
||||
bool uses_thread_id[3];
|
||||
bool uses_local_invocation_idx;
|
||||
} cs;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ radv_fill_shader_variant(struct radv_device *device,
|
|||
S_00B84C_TGID_Z_EN(info->cs.uses_block_id[2]) |
|
||||
S_00B84C_TIDIG_COMP_CNT(info->cs.uses_thread_id[2] ? 2 :
|
||||
info->cs.uses_thread_id[1] ? 1 : 0) |
|
||||
S_00B84C_TG_SIZE_EN(1) |
|
||||
S_00B84C_TG_SIZE_EN(info->cs.uses_local_invocation_idx) |
|
||||
S_00B84C_LDS_SIZE(variant->config.lds_size);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue