summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/nir/nir_to_tgsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/nir/nir_to_tgsi.c')
-rw-r--r--src/gallium/auxiliary/nir/nir_to_tgsi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c
index df76d50af51..ce679418e99 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c
@@ -2573,6 +2573,21 @@ ntt_optimize_nir(struct nir_shader *s, struct pipe_screen *screen)
NIR_PASS(progress, s, nir_opt_undef);
NIR_PASS(progress, s, nir_opt_loop_unroll);
+ /* Try to fold addressing math into ubo_vec4's base to avoid load_consts
+ * and ALU ops for it.
+ */
+ static const nir_opt_offsets_options offset_options = {
+ .ubo_vec4_max = ~0,
+
+ /* No const offset in TGSI for shared accesses. */
+ .shared_max = 0,
+
+ /* unused intrinsics */
+ .uniform_max = 0,
+ .buffer_max = 0,
+ };
+ NIR_PASS(progress, s, nir_opt_offsets, &offset_options);
+
} while (progress);
}