aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/nir
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-05-05 12:44:54 -0400
committerMarge Bot <[email protected]>2020-05-06 16:39:07 +0000
commitd5109741f372173d6e13bdb6fff06c75def19439 (patch)
tree6087ea2a662441b0a8f773faef074d42b2857852 /src/gallium/auxiliary/nir
parent784358bd6e6d59c521133c2a31fa9b88f8e18598 (diff)
tgsi_to_nir: translate non-vec4 image stores correctly
set the correct number of components for src data and the intrinsic Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4908>
Diffstat (limited to 'src/gallium/auxiliary/nir')
-rw-r--r--src/gallium/auxiliary/nir/tgsi_to_nir.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index 34ececa17a3..2865697482e 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -1846,12 +1846,15 @@ ttn_mem(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src)
instr->src[3] = nir_src_for_ssa(nir_imm_int(b, 0)); /* LOD */
}
+ unsigned num_components = util_last_bit(tgsi_inst->Dst[0].Register.WriteMask);
+
if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_STORE) {
- instr->src[3] = nir_src_for_ssa(nir_swizzle(b, src[1], SWIZ(X, Y, Z, W), 4));
+ instr->src[3] = nir_src_for_ssa(nir_swizzle(b, src[1], SWIZ(X, Y, Z, W),
+ num_components));
instr->src[4] = nir_src_for_ssa(nir_imm_int(b, 0)); /* LOD */
}
- instr->num_components = 4;
+ instr->num_components = num_components;
} else {
unreachable("unexpected file");
}