nir/lower_tex: handle lower_tg4_offsets with lower_tg4_broadcom_swizzle
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 15 Jun 2023 08:19:17 +0000 (10:19 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 19 Jun 2023 08:13:06 +0000 (08:13 +0000)
commit0de89e10ba1ccf9a4b579d6eb756e4cf253fb82a
treeb8ee9c9502307e39acdef1cf9e3086be98acd518
parent65353814a395b97a5a472d5eaea6383f4eea6fa3
nir/lower_tex: handle lower_tg4_offsets with lower_tg4_broadcom_swizzle

This pass uses a safe iterator so it can't lower new instructions that are
injected as part of the lowering, which is exactly what lower_tg4_offsets
does, and if lower_tg4_broadcom_swizzle is also set then we need to lower
these new instructions. Handle this by running the pass twice when both
are set: the first pass will only handle lower_tg4_offsets and
the second pass (which will see the new tg4 instructions produced with
lower_tg4_offsets) will process the remaining options, including
lower_tg4_broadcom_swizzle.

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23616>
src/compiler/nir/nir_lower_tex.c