From a48ffce4bd9b96972b13b45fbe0929771e95abfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 19 Mar 2026 22:09:56 -0400 Subject: [PATCH] ac,radeonsi: stop using nir_intrinsic_base for TCS inputs passed via VGPRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also removes one use of input_semantic[]. Acked-by: Pierre-Eric Acked-by: Timur Kristóf Part-of: --- src/amd/llvm/ac_nir_to_llvm.c | 3 ++- src/amd/llvm/ac_shader_abi.h | 2 +- src/gallium/drivers/radeonsi/si_shader_llvm_tess.c | 6 ++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 39c3a35c0fc..ac457f68564 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -2630,7 +2630,8 @@ static LLVMValueRef visit_load_input(struct ac_nir_context *ctx, nir_intrinsic_i LLVMGetElementType(dest_type) : dest_type; LLVMValueRef result = ctx->abi->load_tess_varyings(ctx->abi, component_type, - base, component, count); + nir_intrinsic_io_semantics(instr).location, + component, count); if (instr->def.bit_size == 16) { result = ac_to_integer(&ctx->ac, result); result = LLVMBuildTrunc(ctx->ac.builder, result, dest_type, ""); diff --git a/src/amd/llvm/ac_shader_abi.h b/src/amd/llvm/ac_shader_abi.h index 24c36583959..98b7eabeda5 100644 --- a/src/amd/llvm/ac_shader_abi.h +++ b/src/amd/llvm/ac_shader_abi.h @@ -26,7 +26,7 @@ struct ac_shader_abi { bool is_16bit[AC_LLVM_MAX_OUTPUTS * 4]; LLVMValueRef (*load_tess_varyings)(struct ac_shader_abi *abi, LLVMTypeRef type, - unsigned driver_location, unsigned component, + gl_varying_slot slot, unsigned component, unsigned num_components); LLVMValueRef (*load_ubo)(struct ac_shader_abi *abi, LLVMValueRef index); diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c index 2bd1d2d77a2..9d0f7fe181d 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c @@ -11,18 +11,16 @@ #include "nir.h" static LLVMValueRef si_nir_load_tcs_varyings(struct ac_shader_abi *abi, LLVMTypeRef type, - unsigned driver_location, unsigned component, + gl_varying_slot slot, unsigned component, unsigned num_components) { struct si_shader_context *ctx = si_shader_context_from_abi(abi); - struct si_shader_info *info = &ctx->shader->selector->info; assert(ctx->shader->key.ge.opt.same_patch_vertices); - uint8_t semantic = info->input_semantic[driver_location]; /* Load the TCS input from a VGPR. */ unsigned func_param = ctx->args->ac.tcs_rel_ids.arg_index + 1 + - si_shader_io_get_unique_index(semantic) * 4; + si_shader_io_get_unique_index(slot) * 4; LLVMValueRef value[4]; for (unsigned i = component; i < component + num_components; i++) {