summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-10-13 12:30:40 +0100
committerAlan Hourihane <alanh@tungstengraphics.com>2008-10-13 12:30:40 +0100
commit5bc8ebb12be99ac769a0f2ad1f77a16ebb2bf41f (patch)
tree101702c290cc98946d7b64a7f856b9dd072ba09f /src
parentecac7996d4c5a1e492ce97c5f5cac885941fc711 (diff)
mesa: when emitting an address load instruction, for
indexed elements ensure we write to a single register.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/slang/slang_emit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 9e8daa1051..f3c3fa6c5b 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -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;