v3d: Only look up the 3rd texture gather offset for non-arrays.
[mesa.git] / src / broadcom / compiler / v3d40_tex.c
index 3bed32d839fb603d9abfeb4c87efcfe1b4de7bc0..679f1f15f81c54bedfda4021e93a08e5c39a2055 100644 (file)
@@ -142,7 +142,7 @@ v3d40_vir_emit_tex(struct v3d_compile *c, nir_tex_instr *instr)
                                 if (instr->coord_components >= 2)
                                         p2_unpacked.offset_t =
                                                 nir_src_comp_as_int(instr->src[i].src, 1);
-                                if (instr->coord_components >= 3)
+                                if (non_array_components >= 3)
                                         p2_unpacked.offset_r =
                                                 nir_src_comp_as_int(instr->src[i].src, 2);
                         } else {