Skip to content

r600: fix cayman sfn_nir_legalize_image_load_store ssa dominance

What does this MR do and why?

r600: fix cayman sfn_nir_legalize_image_load_store ssa dominance

After dae57e184aaf ("glsl,st/mesa: always lower IO for GLSL, unlower
IO for drivers"), the shaders updated by sfn_nir_legalize_image_load_store
on cayman could trigger a segmentation fault. The main issue is that
sfn_nir_legalize_image_load_store does not handle properly the ssa
dominance functionality and this issue is exacerbated by this last
mesa update.

This change makes the ssa dominance functionality operational.

This commit is not perfect, it modifies the intrinsic op code to
avoid an infinite loop, which is a trick not used elsewhere,
but it works.

For instance, this issue is triggered on cayman using this
environment variable NIR_DEBUG=validate_ssa_dominance with:
"piglit/bin/oes_egl_image_external_essl3 -auto -fbo":
NIR validation failed after r600_legalize_image_load_store in ../src/gallium/drivers/r600/sfn/sfn_nir.cpp

Signed-off-by: Patrick Lerda <patrick9876@free.fr>

Merge request reports

Loading