v3d/tex: only look up the 2nd texture gather offset for 1d non-arrays
[mesa.git] / src / broadcom / compiler / v3d40_tex.c
index 0a02163100a7832d6a929fe49a6bb673b408db5d..d47d3c30851673b96191e1f1560a2e2944c3ea57 100644 (file)
@@ -136,7 +136,7 @@ v3d40_vir_emit_tex(struct v3d_compile *c, nir_tex_instr *instr)
                 case nir_tex_src_offset: {
                         if (nir_src_is_const(instr->src[i].src)) {
                                 p2_unpacked.offset_s = nir_src_comp_as_int(instr->src[i].src, 0);
-                                if (instr->coord_components >= 2)
+                                if (non_array_components >= 2)
                                         p2_unpacked.offset_t =
                                                 nir_src_comp_as_int(instr->src[i].src, 1);
                                 if (non_array_components >= 3)