nir/lower_non_uniform: set non_uniform=false when lowering is not needed

Fixes RADV compilation of a Doom Eternal pipeline with
PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT, because
nir_opt_non_uniform_access was skipped and later passes don't expect
non-uniform access.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b1619109ca ("nir/lower_non_uniform: remove non_uniform flags after lowering")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27192>
This commit is contained in:
Rhys Perry
2024-01-19 18:04:41 +00:00
committed by Marge Bot
parent 90939e93f6
commit 015b0d678f

View File

@@ -136,8 +136,12 @@ lower_non_uniform_tex_access(const nir_lower_non_uniform_access_options *options
num_handles++;
}
if (num_handles == 0)
if (num_handles == 0) {
/* nu_handle_init() returned false because the handles are uniform. */
tex->texture_non_uniform = false;
tex->sampler_non_uniform = false;
return false;
}
b->cursor = nir_instr_remove(&tex->instr);
@@ -177,8 +181,10 @@ lower_non_uniform_access_intrin(const nir_lower_non_uniform_access_options *opti
return false;
struct nu_handle handle;
if (!nu_handle_init(&handle, &intrin->src[handle_src]))
if (!nu_handle_init(&handle, &intrin->src[handle_src])) {
nir_intrinsic_set_access(intrin, nir_intrinsic_access(intrin) & ~ACCESS_NON_UNIFORM);
return false;
}
b->cursor = nir_instr_remove(&intrin->instr);