ir3: fix has_src() to return correctly in ir3_nir_lower_tex_prefetch
authorHyunjun Ko <zzoon@igalia.com>
Tue, 9 Mar 2021 05:47:21 +0000 (05:47 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 17 Mar 2021 01:09:30 +0000 (01:09 +0000)
This seems to be originally introduced from 2a0d45ae6c, and 562aaea07c
misused the method.

Fixes: 2a0d45ae6c "freedreno/ir3: Add a NIR pass to select tex instructions eligible for pre-fetch"
Fixes: 562aaea07c "freedreno/ir3: respect tex prefetch limits"

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9125>

src/freedreno/ir3/ir3_nir_lower_tex_prefetch.c

index 3847474..8bcccfe 100644 (file)
@@ -107,7 +107,7 @@ ir3_nir_coord_offset(nir_ssa_def *ssa)
 static bool
 has_src(nir_tex_instr *tex, nir_tex_src_type type)
 {
-       return nir_tex_instr_src_index(tex, type) > 0;
+       return nir_tex_instr_src_index(tex, type) >= 0;
 }
 
 static bool