mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
nir/lower_helper_writes: fix stores after discard
We need to use nir_is_helper_invocation instead of
nir_load_helper_invocation, to correctly predicate stores after demote.
Identified in a Piglit on AGX a year ago but I forgot to upstream this.
Fixes: 586da7b329 ("nir: Add nir_lower_helper_writes pass")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33939>
This commit is contained in:
parent
e90ccf91a3
commit
bc6b527b52
1 changed files with 4 additions and 1 deletions
|
|
@ -53,7 +53,10 @@ lower(nir_builder *b, nir_intrinsic_instr *intr, void *data)
|
|||
bool has_dest = nir_intrinsic_infos[intr->intrinsic].has_dest;
|
||||
nir_def *undef = NULL;
|
||||
|
||||
nir_def *helper = nir_load_helper_invocation(b, 1);
|
||||
/* We need to use nir_is_helper_invocation instead of
|
||||
* nir_load_helper_invocation, to correctly predicate stores after demote.
|
||||
*/
|
||||
nir_def *helper = nir_is_helper_invocation(b, 1);
|
||||
nir_push_if(b, nir_inot(b, helper));
|
||||
nir_instr_remove(&intr->instr);
|
||||
nir_builder_instr_insert(b, &intr->instr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue