aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-02-16 17:11:30 +0100
committerMarek Olšák <[email protected]>2017-02-18 02:58:43 +0100
commit73d1c8c686a8e8fe600098cbf8a4f8b27acef105 (patch)
tree3b48cd8714cbbe26d130587a968cdd95633c4fd5 /src/gallium
parent1d1b769561072e62ef516c5d2514e23cbefb2f12 (diff)
tgsi/lowering: stop using TGSI_OPCODE_CLAMP
v2: do it correctly Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_lowering.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_lowering.c b/src/gallium/auxiliary/tgsi/tgsi_lowering.c
index bf6cbb361a9..c26c13b5e58 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_lowering.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_lowering.c
@@ -572,16 +572,25 @@ transform_lit(struct tgsi_transform_context *tctx,
reg_src(&new_inst.Src[1], &ctx->imm, SWIZ(X, X, _, _));
tctx->emit_instruction(tctx, &new_inst);
- /* CLAMP tmpA.z, src.w, -imm{128.0}, imm{128.0} */
+ /* MIN tmpA.z, src.w, imm{128.0} */
new_inst = tgsi_default_full_instruction();
- new_inst.Instruction.Opcode = TGSI_OPCODE_CLAMP;
+ new_inst.Instruction.Opcode = TGSI_OPCODE_MIN;
new_inst.Instruction.NumDstRegs = 1;
reg_dst(&new_inst.Dst[0], &ctx->tmp[A].dst, TGSI_WRITEMASK_Z);
- new_inst.Instruction.NumSrcRegs = 3;
+ new_inst.Instruction.NumSrcRegs = 2;
reg_src(&new_inst.Src[0], src, SWIZ(_, _, W, _));
reg_src(&new_inst.Src[1], &ctx->imm, SWIZ(_, _, Z, _));
+ tctx->emit_instruction(tctx, &new_inst);
+
+ /* MAX tmpA.z, tmpA.z, -imm{128.0} */
+ new_inst = tgsi_default_full_instruction();
+ new_inst.Instruction.Opcode = TGSI_OPCODE_MAX;
+ new_inst.Instruction.NumDstRegs = 1;
+ reg_dst(&new_inst.Dst[0], &ctx->tmp[A].dst, TGSI_WRITEMASK_Z);
+ new_inst.Instruction.NumSrcRegs = 2;
+ reg_src(&new_inst.Src[0], &ctx->tmp[A].src, SWIZ(_, _, Z, _));
+ reg_src(&new_inst.Src[1], &ctx->imm, SWIZ(_, _, Z, _));
new_inst.Src[1].Register.Negate = true;
- reg_src(&new_inst.Src[2], &ctx->imm, SWIZ(_, _, Z, _));
tctx->emit_instruction(tctx, &new_inst);
/* LG2 tmpA.y, tmpA.y */