amd: join emit_kill() from radv and radeonsi in ac_nir_to_llvm
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4047> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4047>
This commit is contained in:

committed by
Marge Bot

parent
bdd7587414
commit
61fb17e8d7
@@ -2970,7 +2970,7 @@ static void emit_discard(struct ac_nir_context *ctx,
|
|||||||
cond = ctx->ac.i1false;
|
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,
|
static void emit_demote(struct ac_nir_context *ctx,
|
||||||
|
@@ -80,8 +80,6 @@ struct ac_shader_abi {
|
|||||||
void (*emit_primitive)(struct ac_shader_abi *abi,
|
void (*emit_primitive)(struct ac_shader_abi *abi,
|
||||||
unsigned stream);
|
unsigned stream);
|
||||||
|
|
||||||
void (*emit_kill)(struct ac_shader_abi *abi, LLVMValueRef visible);
|
|
||||||
|
|
||||||
LLVMValueRef (*load_inputs)(struct ac_shader_abi *abi,
|
LLVMValueRef (*load_inputs)(struct ac_shader_abi *abi,
|
||||||
unsigned location,
|
unsigned location,
|
||||||
unsigned driver_location,
|
unsigned driver_location,
|
||||||
|
@@ -880,13 +880,6 @@ load_gs_input(struct ac_shader_abi *abi,
|
|||||||
return result;
|
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
|
static uint32_t
|
||||||
radv_get_sample_pos_offset(uint32_t num_samples)
|
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) {
|
} else if (shaders[i]->info.stage == MESA_SHADER_FRAGMENT) {
|
||||||
ctx.abi.load_sample_position = load_sample_position;
|
ctx.abi.load_sample_position = load_sample_position;
|
||||||
ctx.abi.load_sample_mask_in = load_sample_mask_in;
|
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 &&
|
if (shaders[i]->info.stage == MESA_SHADER_VERTEX &&
|
||||||
|
@@ -616,14 +616,6 @@ static void si_llvm_emit_polygon_stipple(struct si_shader_context *ctx,
|
|||||||
ac_build_kill_if_false(&ctx->ac, bit);
|
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:
|
* Build the pixel shader prolog function. This handles:
|
||||||
* - two-side color selection and interpolation
|
* - 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_position = load_sample_position;
|
||||||
ctx->abi.load_sample_mask_in = load_sample_mask_in;
|
ctx->abi.load_sample_mask_in = load_sample_mask_in;
|
||||||
ctx->abi.emit_fbfetch = si_nir_emit_fbfetch;
|
ctx->abi.emit_fbfetch = si_nir_emit_fbfetch;
|
||||||
ctx->abi.emit_kill = si_llvm_emit_kill;
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user