diff options
author | Eric Anholt <[email protected]> | 2018-12-27 23:11:49 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-01-14 13:18:02 -0800 |
commit | 3790ee07e6666f734dd595c4c4dd3501a741a59a (patch) | |
tree | 3a50c405dc2e301ae1410d68451f2e82552269fd | |
parent | 619a28b845118707a4968ab1e3d8eb67da7a44cb (diff) |
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
-rw-r--r-- | src/broadcom/compiler/v3d_nir_lower_txf_ms.c | 18 |
1 files changed, 10 insertions, 8 deletions
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, |