agx: Don't blow up when lowering textures twice

Hard to avoid with GS.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
This commit is contained in:
Alyssa Rosenzweig
2023-08-11 19:18:23 -04:00
committed by Marge Bot
parent 7f636a08c8
commit 8701ad4396

View File

@@ -305,6 +305,10 @@ lower_regular_texture(nir_builder *b, nir_instr *instr, UNUSED void *data)
if (tex->sampler_dim == GLSL_SAMPLER_DIM_BUF)
return lower_buffer_texture(b, tex);
/* Don't lower twice */
if (nir_tex_instr_src_index(tex, nir_tex_src_backend1) >= 0)
return false;
/* Get the coordinates */
nir_def *coord = nir_steal_tex_src(tex, nir_tex_src_coord);
nir_def *ms_idx = nir_steal_tex_src(tex, nir_tex_src_ms_index);