mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 13:20:25 +01:00
mesa: when emitting an address load instruction, for
indexed elements ensure we write to a single register.
This commit is contained in:
parent
ecac7996d4
commit
5bc8ebb12b
1 changed files with 5 additions and 1 deletions
|
|
@ -1579,13 +1579,17 @@ emit_array_element(slang_emit_info *emitInfo, slang_ir_node *n)
|
|||
else {
|
||||
/* Variable array index */
|
||||
struct prog_instruction *inst;
|
||||
slang_ir_storage dstStore = *n->Store;
|
||||
|
||||
/* do codegen for array index expression */
|
||||
emit(emitInfo, n->Children[1]);
|
||||
|
||||
inst = new_instruction(emitInfo, OPCODE_ARL);
|
||||
|
||||
storage_to_dst_reg(&inst->DstReg, n->Store, n->Writemask);
|
||||
if (dstStore.Size > 4)
|
||||
dstStore.Size = 4; /* only emit one instruction */
|
||||
|
||||
storage_to_dst_reg(&inst->DstReg, &dstStore, n->Writemask);
|
||||
storage_to_src_reg(&inst->SrcReg[0], n->Children[1]->Store);
|
||||
|
||||
inst->DstReg.File = PROGRAM_ADDRESS;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue