Skip to content

nir: Usher nir_normalize_cubemap_coords into 2022

I stumbled upon this old NIR pass (still in use by intel and broadcom) and noticed how most of the code was NIR boilerplate that we have helpers for. Rewrite the pass to use all the helpers.

The only intended functional change is that the code now asserts that encountered tex instructions have a tex_src_coord, rather than silently ignoring tex instructions that don't. Given the nature of the pass I think that's reasonable.

Note: not actually tested beyond "it compiles" because I don't have intel or broadcom hardware.

Cc @jekstrand @anholt

Merge request reports