From c47fe54bc785788147f1f1808d0da720995f5447 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 12 Nov 2020 17:32:41 -0600 Subject: [PATCH] nir/lower_non_uniform: Better handle non-derefs In particular, if we have an index or bindless handle we were passing the original handle which, technically, is uniform within the context of the if. However, we can save the back-end compiler some effort if we pass it the result of the read_first_invocation(). (Rebased by Kenneth Graunke and Rhys Perry.) Reviewed-by: Kenneth Graunke Reviewed-by: Rhys Perry Part-of: --- src/compiler/nir/nir_lower_non_uniform_access.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_lower_non_uniform_access.c b/src/compiler/nir/nir_lower_non_uniform_access.c index 009beb4bb97..a5b1bce4d4e 100644 --- a/src/compiler/nir/nir_lower_non_uniform_access.c +++ b/src/compiler/nir/nir_lower_non_uniform_access.c @@ -74,6 +74,8 @@ nu_handle_rewrite(nir_builder *b, struct nu_handle *h) nir_deref_instr *deref = nir_build_deref_array(b, h->parent_deref, h->first); *(h->src) = nir_src_for_ssa(&deref->dest.ssa); + } else { + *(h->src) = nir_src_for_ssa(h->first); } }