From 07f5cbcd9b79ae5159cba839532c76b01a65b21e Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Sat, 14 Jun 2025 07:43:07 +0200 Subject: [PATCH] etnaviv: nir: Add assertion to prevent src2 conflicts in texture instructions Add an assert to catch cases where both nir_tex_src_comparator and nir_tex_src_ddy attempt to use the same src2 slot in texture instructions. This prevents silent overwrites that could cause incorrect shader compilation. The assertion helps catch potential issues in complex texture operations like those found in dEQP textureGrad shadow tests, where multiple texture sources compete for the same hardware slot. Signed-off-by: Christian Gmeiner Reviewed-by: Lucas Stach Part-of: --- src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c index e0559c18c5c..3286533cf8e 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c @@ -556,6 +556,7 @@ emit_tex(struct etna_compile *c, nir_tex_instr * tex) break; case nir_tex_src_comparator: case nir_tex_src_ddy: + assert(!src2); src2 = &tex->src[i].src; break; default: