From 8701ad439660d199670c3d40e76a41cab1613c94 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 11 Aug 2023 19:18:23 -0400 Subject: [PATCH] agx: Don't blow up when lowering textures twice Hard to avoid with GS. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_nir_lower_texture.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/asahi/compiler/agx_nir_lower_texture.c b/src/asahi/compiler/agx_nir_lower_texture.c index e533e271da4..2430e5b8c4f 100644 --- a/src/asahi/compiler/agx_nir_lower_texture.c +++ b/src/asahi/compiler/agx_nir_lower_texture.c @@ -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);