Mesa (master): v3d/tex: only look up the 2nd texture gather offset for 1d non-arrays

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 12 00:06:44 UTC 2020


Module: Mesa
Branch: master
Commit: 50c2c76ea31edf987594e8b811b7d62be71f5a33
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=50c2c76ea31edf987594e8b811b7d62be71f5a33

Author: Alejandro Piñeiro <apinheiro at igalia.com>
Date:   Wed Apr 29 00:33:47 2020 +0200

v3d/tex: only look up the 2nd texture gather offset for 1d non-arrays

Commit 1bc71e8b655f2f02b3e3a0af34c7cad12b9cb83d already did that for
the 3rd offset, but it also needs to do it for the 2nd (to handle 1d
array).

Fixes assertion failures with Vulkan CTS tests using 1darray
targets. Seems that there isn't too many 1darray tests on OpenGL CTS,
and OpenGL-ES don't support 1d arrays, but the same problem could
arise eventually on OpenGL.

Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4962>

---

 src/broadcom/compiler/v3d40_tex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/broadcom/compiler/v3d40_tex.c b/src/broadcom/compiler/v3d40_tex.c
index 0a02163100a..d47d3c30851 100644
--- a/src/broadcom/compiler/v3d40_tex.c
+++ b/src/broadcom/compiler/v3d40_tex.c
@@ -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)



More information about the mesa-commit mailing list