mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
pvr: Use demote
Signed-off-by: Ella Stanforth <ella@igalia.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
parent
38c52b9a0f
commit
d917cad061
2 changed files with 7 additions and 5 deletions
|
|
@ -33,6 +33,7 @@ static const struct spirv_to_nir_options spirv_options = {
|
|||
|
||||
/** NIR options. */
|
||||
static const nir_shader_compiler_options nir_options = {
|
||||
.discard_is_demote = true,
|
||||
.fuse_ffma32 = true,
|
||||
|
||||
.has_fused_comp_and_csel = true,
|
||||
|
|
@ -497,6 +498,7 @@ void pco_preprocess_nir(pco_ctx *ctx, nir_shader *nir)
|
|||
.point_coord = true,
|
||||
};
|
||||
NIR_PASS(_, nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings);
|
||||
NIR_PASS(_, nir, nir_lower_helper_writes, true);
|
||||
}
|
||||
|
||||
NIR_PASS(_, nir, nir_lower_system_values);
|
||||
|
|
|
|||
|
|
@ -447,8 +447,8 @@ static bool is_pfo(const nir_instr *instr, UNUSED const void *cb_data)
|
|||
switch (intr->intrinsic) {
|
||||
case nir_intrinsic_store_output:
|
||||
case nir_intrinsic_load_output:
|
||||
case nir_intrinsic_terminate:
|
||||
case nir_intrinsic_terminate_if:
|
||||
case nir_intrinsic_demote:
|
||||
case nir_intrinsic_demote_if:
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
|
@ -507,13 +507,13 @@ static nir_def *lower_pfo(nir_builder *b, nir_instr *instr, void *cb_data)
|
|||
case nir_intrinsic_load_output:
|
||||
return lower_pfo_load(b, intr, state);
|
||||
|
||||
case nir_intrinsic_terminate:
|
||||
case nir_intrinsic_demote:
|
||||
state->has_discards = true;
|
||||
state->last_discard_store =
|
||||
nir_build_store_reg(b, nir_imm_true(b), state->discard_cond_reg);
|
||||
return NIR_LOWER_INSTR_PROGRESS_REPLACE;
|
||||
|
||||
case nir_intrinsic_terminate_if: {
|
||||
case nir_intrinsic_demote_if: {
|
||||
state->has_discards = true;
|
||||
nir_def *val = nir_load_reg(b, state->discard_cond_reg);
|
||||
val = nir_ior(b, val, intr->src[0].ssa);
|
||||
|
|
@ -690,7 +690,7 @@ lower_alpha_to_coverage(nir_builder *b, nir_instr *instr, UNUSED void *cb_data)
|
|||
a2c_mask,
|
||||
nir_ishl(b, nir_imm_int(b, 1), nir_load_sample_id(b)));
|
||||
|
||||
nir_terminate_if(b, nir_ieq_imm(b, a2c_mask, 0));
|
||||
nir_demote_if(b, nir_ieq_imm(b, a2c_mask, 0));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue