aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiklós Máté <[email protected]>2016-08-08 00:48:31 +0200
committerMarek Olšák <[email protected]>2016-08-10 15:03:58 +0200
commit88c2fc6b2deca6ff54f37a100f6f0a0382f8049e (patch)
tree57e9e94ef0aed0dcdcd679425d826d5df96526a2 /src
parent9a4d5db4d2d6a11cb4760bfe265cc9065616e28e (diff)
st/mesa: in ATI fs don't assume TEMP0=REG0
The temporaries are allocated dynamically. Signed-off-by: Miklós Máté <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_atifs_to_tgsi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_atifs_to_tgsi.c b/src/mesa/state_tracker/st_atifs_to_tgsi.c
index 66f442aee5a..ae08796dd51 100644
--- a/src/mesa/state_tracker/st_atifs_to_tgsi.c
+++ b/src/mesa/state_tracker/st_atifs_to_tgsi.c
@@ -691,6 +691,7 @@ transform_inst:
struct tgsi_full_instruction inst;
unsigned i;
int fogc_index = -1;
+ int reg0_index = current_inst->Src[0].Register.Index;
/* find FOGC input */
for (i = 0; i < ctx->info.num_inputs; i++) {
@@ -804,11 +805,11 @@ transform_inst:
inst.Instruction.Opcode = TGSI_OPCODE_LRP;
inst.Instruction.NumDstRegs = 1;
inst.Dst[0].Register.File = TGSI_FILE_TEMPORARY;
- inst.Dst[0].Register.Index = 0;
+ inst.Dst[0].Register.Index = reg0_index;
inst.Dst[0].Register.WriteMask = TGSI_WRITEMASK_XYZW;
inst.Instruction.NumSrcRegs = 3;
SET_SRC(&inst, 0, TGSI_FILE_TEMPORARY, ctx->fog_factor_temp, X, X, X, Y);
- SET_SRC(&inst, 1, TGSI_FILE_TEMPORARY, 0, X, Y, Z, W);
+ SET_SRC(&inst, 1, TGSI_FILE_TEMPORARY, reg0_index, X, Y, Z, W);
SET_SRC(&inst, 2, TGSI_FILE_CONSTANT, MAX_NUM_FRAGMENT_CONSTANTS_ATI + 1, X, Y, Z, W);
tctx->emit_instruction(tctx, &inst);
}