mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 04:00:10 +01:00
nir: lower is/load_helper to zero if no helper lanes are needed
If there are no helper invocations required during the execution of the shader, we can assume that there also are no helper invocations active. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9058>
This commit is contained in:
parent
b689a65316
commit
2e6c9e54f1
1 changed files with 8 additions and 1 deletions
|
|
@ -62,8 +62,15 @@ nir_lower_demote_to_discard_instr(nir_builder *b, nir_instr *instr, void *data)
|
|||
intrin->intrinsic = nir_intrinsic_discard_if;
|
||||
return true;
|
||||
case nir_intrinsic_is_helper_invocation:
|
||||
intrin->intrinsic = nir_intrinsic_load_helper_invocation;
|
||||
case nir_intrinsic_load_helper_invocation: {
|
||||
/* If the shader doesn't need helper invocations,
|
||||
* we can assume there are none */
|
||||
b->cursor = nir_before_instr(instr);
|
||||
nir_ssa_def *zero = nir_imm_false(b);
|
||||
nir_ssa_def_rewrite_uses_ssa(&intrin->dest.ssa, zero);
|
||||
nir_instr_remove_v(instr);
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue