r600: move stores to the end of shader when required

This change is inspired from 1e0e521a7d ("broadcom/compiler:
move stores to the end of shader") and makes the khr cull_distance
tests which were broken after dae57e184a functionals again.

Fixes: dae57e184a ("glsl,st/mesa: always lower IO for GLSL, unlower IO for drivers")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34154>
This commit is contained in:
Patrick Lerda 2025-03-21 14:33:17 +01:00 committed by Marge Bot
parent 8742927d8f
commit 4c2b2c82b0

View file

@ -771,6 +771,9 @@ r600_lower_and_optimize_nir(nir_shader *sh,
(nir_lower_io_lower_64bit_to_32 |
nir_lower_io_use_interpolated_input_intrinsics));
if (sh->info.stage == MESA_SHADER_VERTEX || sh->info.stage == MESA_SHADER_TESS_EVAL)
NIR_PASS(_, sh, nir_move_output_stores_to_end);
nir_shader_gather_info(sh, nir_shader_get_entrypoint(sh));
bool lower_64bit_io_to_vec2 = (sh->info.bit_sizes_float | sh->info.bit_sizes_int) & 64;