mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-17 15:40:20 +01:00
agx: Handle splits of uniforms
This is straightforward, and can happen with certain u2u16 patterns. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22891>
This commit is contained in:
parent
221b329a98
commit
632014ece0
1 changed files with 8 additions and 4 deletions
|
|
@ -563,23 +563,27 @@ agx_ra(agx_context *ctx)
|
|||
agx_remove_instruction(ins);
|
||||
continue;
|
||||
} else if (ins->op == AGX_OPCODE_SPLIT) {
|
||||
assert(ins->src[0].type == AGX_INDEX_REGISTER);
|
||||
unsigned base = ins->src[0].value;
|
||||
unsigned width = agx_size_align_16(agx_split_width(ins));
|
||||
assert(ins->src[0].type == AGX_INDEX_REGISTER ||
|
||||
ins->src[0].type == AGX_INDEX_UNIFORM);
|
||||
|
||||
struct agx_copy copies[4];
|
||||
assert(ins->nr_dests <= ARRAY_SIZE(copies));
|
||||
|
||||
unsigned n = 0;
|
||||
unsigned width = agx_size_align_16(agx_split_width(ins));
|
||||
|
||||
/* Move the sources */
|
||||
agx_foreach_dest(ins, i) {
|
||||
if (ins->dest[i].type != AGX_INDEX_REGISTER)
|
||||
continue;
|
||||
|
||||
agx_index src = ins->src[0];
|
||||
src.size = ins->dest[i].size;
|
||||
src.value += (i * width);
|
||||
|
||||
copies[n++] = (struct agx_copy){
|
||||
.dest = ins->dest[i].value,
|
||||
.src = agx_register(base + (i * width), ins->dest[i].size),
|
||||
.src = src,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue