diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2008-10-15 13:21:11 +1100 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2008-10-15 13:21:11 +1100 |
commit | 295d6f8e8f03192320aa8d4ed767427dd06071a5 (patch) | |
tree | ca8d7949d700d96b7d123366aa57b80894d1757f /src/mesa/shader/slang | |
parent | 2882a2db7a766c60bb231978ea829632438dd8a4 (diff) | |
parent | 41ccdde767e7aba6e8e6a9a035eacd6338c03a95 (diff) |
Merge remote branch 'origin/gallium-0.2' into gallium-0.2
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 6 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_link.c | 2 |
2 files changed, 6 insertions, 2 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; diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index d884be2a75..00e8953768 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -408,7 +408,7 @@ _slang_update_inputs_outputs(struct gl_program *prog) } } else if (inst->SrcReg[j].File == PROGRAM_ADDRESS) { - maxAddrReg = MAX2(maxAddrReg, inst->SrcReg[j].Index + 1); + maxAddrReg = MAX2(maxAddrReg, (GLuint) (inst->SrcReg[j].Index + 1)); } } if (inst->DstReg.File == PROGRAM_OUTPUT) { |