Properly handle render target formats with <4 components.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18687>
b->shader->did_writeout = true;
return agx_st_tile(b, agx_src_index(&instr->src[0]),
- b->shader->key->fs.tib_formats[rt]);
+ b->shader->key->fs.tib_formats[rt],
+ nir_intrinsic_write_mask(instr));
}
static void
b->shader->did_writeout = true;
b->shader->out->reads_tib = true;
- agx_ld_tile_to(b, dest, b->shader->key->fs.tib_formats[rt]);
- agx_emit_cached_split(b, dest, 4);
+ unsigned nr_comps = nir_dest_num_components(instr->dest);
+ agx_ld_tile_to(b, dest, b->shader->key->fs.tib_formats[rt],
+ BITFIELD_MASK(nr_comps));
+ agx_emit_cached_split(b, dest, nr_comps);
}
static enum agx_format
op("sample_mask", (0x7fc1, 0xffff, 6, _), dests = 0, srcs = 1, can_eliminate = False)
# Essentially same encoding
-op("ld_tile", (0x49, 0x7F, 8, _), dests = 1, srcs = 0,
- can_eliminate = False, imms = [FORMAT])
+op("ld_tile", (0x49, 0x7F, 8, _), dests = 1, srcs = 0, imms = [FORMAT, MASK])
op("st_tile", (0x09, 0x7F, 8, _), dests = 0, srcs = 1,
- can_eliminate = False, imms = [FORMAT])
+ can_eliminate = False, imms = [FORMAT, MASK])
for (name, exact) in [("any", 0xC000), ("none", 0xC200)]:
op("jmp_exec_" + name, (exact, (1 << 16) - 1, 6, _), dests = 0, srcs = 0,
bool load = (I->op == AGX_OPCODE_LD_TILE);
unsigned D = agx_pack_alu_dst(load ? I->dest[0] : I->src[0]);
unsigned rt = 0; /* TODO */
- unsigned mask = I->mask ?: 0xF;
- assert(mask < 0x10);
+ assert(I->mask < 0x10);
uint64_t raw =
0x09 |
((uint64_t) (I->format) << 24) |
((uint64_t) (rt) << 32) |
(load ? (1ull << 35) : 0) |
- ((uint64_t) (mask) << 36) |
+ ((uint64_t) (I->mask) << 36) |
((uint64_t) 0x0380FC << 40) |
(((uint64_t) (D >> 8)) << 60);