Commit 0f574342 authored by Jonathan Marek's avatar Jonathan Marek
Browse files

freedreno/ir3: disable texture prefetch for 1d array textures

Prefetch only supports the basic 2D texture case, checking is_array is
needed because 1d array textures pass the coord num_components==2 test.

Fixes: 2a0d45ae

 ("freedreno/ir3: Add a NIR pass to select tex instructions eligible for pre-fetch")
Signed-off-by: Jonathan Marek's avatarJonathan Marek <>
Reviewed-by: Rob Clark's avatarRob Clark <>
parent ef9635d0
Pipeline #79843 passed with stages
in 37 minutes and 58 seconds
......@@ -99,13 +99,8 @@ coord_offset(nir_ssa_def *ssa)
ir3_nir_coord_offset(nir_ssa_def *ssa)
/* only prefetch for simple 2d tex fetch case. Note this check only
* applies to the tex coord src itself, and not in the case where
* we recursively chase a vecN's src.
if (ssa->num_components != 2)
return -1;
assert (ssa->num_components == 2);
return coord_offset(ssa);
......@@ -140,6 +135,10 @@ lower_tex_prefetch_block(nir_block *block)
has_src(tex, nir_tex_src_sampler_offset))
/* only prefetch for simple 2d tex fetch case */
if (tex->sampler_dim != GLSL_SAMPLER_DIM_2D || tex->is_array)
int idx = nir_tex_instr_src_index(tex, nir_tex_src_coord);
/* First source should be the sampling coordinate. */
nir_tex_src *coord = &tex->src[idx];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment