mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 08:10:09 +01:00
radeonsi: use postponed KILL only when derivatives are used
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
478afbe525
commit
da0083f123
4 changed files with 9 additions and 3 deletions
|
|
@ -5846,8 +5846,7 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx,
|
|||
}
|
||||
}
|
||||
|
||||
if (ctx->type == PIPE_SHADER_FRAGMENT && sel->info.uses_kill &&
|
||||
ctx->screen->b.debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL)) {
|
||||
if (sel->force_correct_derivs_after_kill) {
|
||||
ctx->postponed_kill = lp_build_alloca_undef(&ctx->gallivm, ctx->i1, "");
|
||||
/* true = don't kill. */
|
||||
LLVMBuildStore(ctx->ac.builder, LLVMConstInt(ctx->i1, 1, 0),
|
||||
|
|
|
|||
|
|
@ -344,6 +344,7 @@ struct si_shader_selector {
|
|||
/* PIPE_SHADER_[VERTEX|FRAGMENT|...] */
|
||||
unsigned type;
|
||||
bool vs_needs_prolog;
|
||||
bool force_correct_derivs_after_kill;
|
||||
unsigned pa_cl_vs_out_cntl;
|
||||
ubyte clipdist_mask;
|
||||
ubyte culldist_mask;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static void kil_emit(const struct lp_build_tgsi_action *action,
|
|||
visible = LLVMConstInt(ctx->i1, false, 0);
|
||||
}
|
||||
|
||||
if (ctx->postponed_kill) {
|
||||
if (ctx->shader->selector->force_correct_derivs_after_kill) {
|
||||
LLVMValueRef mask = LLVMBuildLoad(builder, ctx->postponed_kill, "");
|
||||
mask = LLVMBuildAnd(builder, mask, visible, "");
|
||||
LLVMBuildStore(builder, mask, ctx->postponed_kill);
|
||||
|
|
|
|||
|
|
@ -2052,6 +2052,12 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
|
|||
sel->info.num_inputs &&
|
||||
!sel->info.properties[TGSI_PROPERTY_VS_BLIT_SGPRS];
|
||||
|
||||
sel->force_correct_derivs_after_kill =
|
||||
sel->type == PIPE_SHADER_FRAGMENT &&
|
||||
sel->info.uses_derivatives &&
|
||||
sel->info.uses_kill &&
|
||||
sctx->screen->b.debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL);
|
||||
|
||||
/* Set which opcode uses which (i,j) pair. */
|
||||
if (sel->info.uses_persp_opcode_interp_centroid)
|
||||
sel->info.uses_persp_centroid = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue