Still no writemasks.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
address.dest_type = nir_type_uint32;
address.writemask = (1 << 12) - 1;
+ unsigned nr = nir_intrinsic_src_components(instr, 0);
+ assert(nir_intrinsic_write_mask(instr) == ((1 << nr) - 1));
+
bi_instruction st = {
.type = BI_STORE_VAR,
.src = {
nir_type_uint32, nir_type_uint32, nir_type_uint32,
},
.swizzle = {
- { 0, 1, 2, 3 },
+ { 0 },
{ 0 }, { 1 }, { 2}
},
- .store_channels = 4, /* TODO: WRITEMASK */
+ .store_channels = nr,
};
+ for (unsigned i = 0; i < nr; ++i)
+ st.swizzle[0][i] = i;
+
bi_emit(ctx, address);
bi_emit(ctx, st);
}