}
}
- if (sel->force_correct_derivs_after_kill) {
- ctx->postponed_kill = ac_build_alloca_undef(&ctx->ac, ctx->ac.i1, "");
- /* true = don't kill. */
- LLVMBuildStore(ctx->ac.builder, ctx->ac.i1true,
- ctx->postponed_kill);
- }
-
bool success = si_nir_build_llvm(ctx, nir);
if (free_nir)
ralloc_free(nir);
/* PIPE_SHADER_[VERTEX|FRAGMENT|...] */
enum pipe_shader_type type;
bool vs_needs_prolog;
- bool force_correct_derivs_after_kill;
bool prim_discard_cs_allowed;
bool ngg_culling_allowed;
unsigned num_vs_inputs;
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
LLVMBuilderRef builder = ctx->ac.builder;
- if (ctx->shader->selector->force_correct_derivs_after_kill) {
- /* Kill immediately while maintaining WQM. */
- ac_build_kill_if_false(&ctx->ac,
- ac_build_wqm_vote(&ctx->ac, visible));
-
- LLVMValueRef mask = LLVMBuildLoad(builder, ctx->postponed_kill, "");
- mask = LLVMBuildAnd(builder, mask, visible, "");
- LLVMBuildStore(builder, mask, ctx->postponed_kill);
- return;
- }
-
ac_build_kill_if_false(&ctx->ac, visible);
}
NIR_PASS_V(nir, nir_lower_bool_to_int32);
NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp);
+
+ if (sscreen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL))
+ NIR_PASS_V(nir, nir_lower_discard_to_demote);
}
void si_finalize_nir(struct pipe_screen *screen, void *nirptr, bool optimize)
shader_variant_flags |= 1 << 1;
if (si_get_wave_size(sel->screen, sel->type, ngg, es) == 32)
shader_variant_flags |= 1 << 2;
- if (sel->force_correct_derivs_after_kill)
+ if (sel->type == PIPE_SHADER_FRAGMENT &&
+ sel->info.uses_derivatives &&
+ sel->info.uses_kill &&
+ sel->screen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL))
shader_variant_flags |= 1 << 3;
struct mesa_sha1 ctx;
sel->info.num_inputs &&
!sel->info.properties[TGSI_PROPERTY_VS_BLIT_SGPRS_AMD];
- sel->force_correct_derivs_after_kill =
- sel->type == PIPE_SHADER_FRAGMENT &&
- sel->info.uses_derivatives &&
- sel->info.uses_kill &&
- sctx->screen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL);
-
sel->prim_discard_cs_allowed =
sel->type == PIPE_SHADER_VERTEX &&
!sel->info.uses_bindless_images &&