From b7f99401f4b4e7ea992a876a093d11e90e2f13b2 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 30 Sep 2020 09:51:08 +0200 Subject: [PATCH] radeonsi: remove dead code in TCS/TES/GS since const_index is always 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/gallium/drivers/radeonsi/si_shader_llvm_gs.c | 2 +- src/gallium/drivers/radeonsi/si_shader_llvm_tess.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_gs.c b/src/gallium/drivers/radeonsi/si_shader_llvm_gs.c index 6b38160c936..1a03c35c074 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_gs.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_gs.c @@ -104,7 +104,7 @@ static LLVMValueRef si_nir_load_input_gs(struct ac_shader_abi *abi, unsigned loc LLVMValueRef value[4]; for (unsigned i = component; i < component + num_components; i++) { - value[i] = si_llvm_load_input_gs(&ctx->abi, driver_location / 4 + const_index, + value[i] = si_llvm_load_input_gs(&ctx->abi, driver_location / 4, vertex_index, type, i); } diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c index 5bb3eeb7e05..ac3390fc0b7 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_tess.c @@ -415,7 +415,7 @@ static LLVMValueRef si_nir_load_tcs_varyings(struct ac_shader_abi *abi, LLVMType } if (!param_index) { - param_index = LLVMConstInt(ctx->ac.i32, const_index, 0); + param_index = ctx->ac.i32_0; } dw_addr = get_dw_address_from_generic_indices(ctx, stride, dw_addr, vertex_index, param_index, @@ -449,7 +449,7 @@ static LLVMValueRef si_nir_load_input_tes(struct ac_shader_abi *abi, LLVMTypeRef base = ac_get_arg(&ctx->ac, ctx->tcs_offchip_offset); if (!param_index) { - param_index = LLVMConstInt(ctx->ac.i32, const_index, 0); + param_index = ctx->ac.i32_0; } addr = @@ -483,7 +483,7 @@ static void si_nir_store_output_tcs(struct ac_shader_abi *abi, const struct nir_ bool is_const = !param_index; if (!param_index) - param_index = LLVMConstInt(ctx->ac.i32, const_index, 0); + param_index = ctx->ac.i32_0; const bool is_patch = vertex_index == NULL; @@ -502,7 +502,7 @@ static void si_nir_store_output_tcs(struct ac_shader_abi *abi, const struct nir_ dw_addr = get_dw_address_from_generic_indices(ctx, NULL, dw_addr, vertex_index, param_index, semantic); - if (is_const && const_index == 0) { + if (is_const) { int semantic = info->output_semantic[driver_location]; /* Always write tess factors into LDS for the TCS epilog. */