From: Daniel Schürmann Date: Wed, 4 Mar 2020 16:49:06 +0000 (+0100) Subject: amd: join emit_kill() from radv and radeonsi in ac_nir_to_llvm X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=61fb17e8d74b9b38f54780483157682fe9d3e312;p=mesa.git amd: join emit_kill() from radv and radeonsi in ac_nir_to_llvm Reviewed-by: Marek Olšák Tested-by: Marge Bot Part-of: --- diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 81ef47651eb..0ecf56c8e30 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -2970,7 +2970,7 @@ static void emit_discard(struct ac_nir_context *ctx, cond = ctx->ac.i1false; } - ctx->abi->emit_kill(ctx->abi, cond); + ac_build_kill_if_false(&ctx->ac, cond); } static void emit_demote(struct ac_nir_context *ctx, diff --git a/src/amd/llvm/ac_shader_abi.h b/src/amd/llvm/ac_shader_abi.h index ea977fc0cfa..f73465b014f 100644 --- a/src/amd/llvm/ac_shader_abi.h +++ b/src/amd/llvm/ac_shader_abi.h @@ -80,8 +80,6 @@ struct ac_shader_abi { void (*emit_primitive)(struct ac_shader_abi *abi, unsigned stream); - void (*emit_kill)(struct ac_shader_abi *abi, LLVMValueRef visible); - LLVMValueRef (*load_inputs)(struct ac_shader_abi *abi, unsigned location, unsigned driver_location, diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_to_llvm.c index 49c91aeb04e..5bce7b156c3 100644 --- a/src/amd/vulkan/radv_nir_to_llvm.c +++ b/src/amd/vulkan/radv_nir_to_llvm.c @@ -880,13 +880,6 @@ load_gs_input(struct ac_shader_abi *abi, return result; } - -static void radv_emit_kill(struct ac_shader_abi *abi, LLVMValueRef visible) -{ - struct radv_shader_context *ctx = radv_shader_context_from_abi(abi); - ac_build_kill_if_false(&ctx->ac, visible); -} - static uint32_t radv_get_sample_pos_offset(uint32_t num_samples) { @@ -4141,7 +4134,6 @@ LLVMModuleRef ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm, } else if (shaders[i]->info.stage == MESA_SHADER_FRAGMENT) { ctx.abi.load_sample_position = load_sample_position; ctx.abi.load_sample_mask_in = load_sample_mask_in; - ctx.abi.emit_kill = radv_emit_kill; } if (shaders[i]->info.stage == MESA_SHADER_VERTEX && diff --git a/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c b/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c index ea8077dcc28..c2efcc88e99 100644 --- a/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c +++ b/src/gallium/drivers/radeonsi/si_shader_llvm_ps.c @@ -616,14 +616,6 @@ static void si_llvm_emit_polygon_stipple(struct si_shader_context *ctx, ac_build_kill_if_false(&ctx->ac, bit); } -static void si_llvm_emit_kill(struct ac_shader_abi *abi, LLVMValueRef visible) -{ - struct si_shader_context *ctx = si_shader_context_from_abi(abi); - LLVMBuilderRef builder = ctx->ac.builder; - - ac_build_kill_if_false(&ctx->ac, visible); -} - /** * Build the pixel shader prolog function. This handles: * - two-side color selection and interpolation @@ -1046,5 +1038,4 @@ void si_llvm_init_ps_callbacks(struct si_shader_context *ctx) ctx->abi.load_sample_position = load_sample_position; ctx->abi.load_sample_mask_in = load_sample_mask_in; ctx->abi.emit_fbfetch = si_nir_emit_fbfetch; - ctx->abi.emit_kill = si_llvm_emit_kill; }