From: Eric Anholt Date: Fri, 28 Dec 2018 07:11:49 +0000 (-0800) Subject: v3d: Fix txf_ms 2D_ARRAY array index. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3790ee07e6666f734dd595c4c4dd3501a741a59a;p=mesa.git v3d: Fix txf_ms 2D_ARRAY array index. We need to pass the array index through our coordinate transform unchanged. Fixes dEQP-GLES31.functional.texture.multisample.samples_1.*_2d_array --- diff --git a/src/broadcom/compiler/v3d_nir_lower_txf_ms.c b/src/broadcom/compiler/v3d_nir_lower_txf_ms.c index ffaee0d76cd..68591529d36 100644 --- a/src/broadcom/compiler/v3d_nir_lower_txf_ms.c +++ b/src/broadcom/compiler/v3d_nir_lower_txf_ms.c @@ -49,14 +49,16 @@ vc4_nir_lower_txf_ms_instr(struct v3d_compile *c, nir_builder *b, nir_ssa_def *sample = instr->src[sample_index].src.ssa; nir_ssa_def *one = nir_imm_int(b, 1); - coord = nir_ishl(b, coord, nir_imm_int(b, 1)); - coord = nir_vec2(b, - nir_iadd(b, - nir_channel(b, coord, 0), - nir_iand(b, sample, one)), - nir_iadd(b, - nir_channel(b, coord, 1), - nir_iand(b, nir_ushr(b, sample, one), one))); + nir_ssa_def *x = nir_iadd(b, + nir_ishl(b, nir_channel(b, coord, 0), one), + nir_iand(b, sample, one)); + nir_ssa_def *y = nir_iadd(b, + nir_ishl(b, nir_channel(b, coord, 1), one), + nir_iand(b, nir_ushr(b, sample, one), one)); + if (instr->is_array) + coord = nir_vec3(b, x, y, nir_channel(b, coord, 2)); + else + coord = nir_vec2(b, x, y); nir_instr_rewrite_src(&instr->instr, &instr->src[nir_tex_src_coord].src,