aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-08-10 08:38:53 +0200
committermarha <marha@users.sourceforge.net>2011-08-10 08:38:53 +0200
commitfd1f4d9fe3ea67fa6def8ee4927a8f71e0440f12 (patch)
treef9242a86411de082fe1ab6a2db76706d8ba0dddc /mesalib/src/mesa/state_tracker
parent93ed12672618a2e321cb79a3b3a656aae63d6beb (diff)
downloadvcxsrv-fd1f4d9fe3ea67fa6def8ee4927a8f71e0440f12.tar.gz
vcxsrv-fd1f4d9fe3ea67fa6def8ee4927a8f71e0440f12.tar.bz2
vcxsrv-fd1f4d9fe3ea67fa6def8ee4927a8f71e0440f12.zip
mesa xserver git update 10 aug 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index d7a1ba80e..aef23e7d2 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1994,15 +1994,17 @@ glsl_to_tgsi_visitor::visit(ir_assignment *ir)
} else if (ir->rhs->as_expression() &&
this->instructions.get_tail() &&
ir->rhs == ((glsl_to_tgsi_instruction *)this->instructions.get_tail())->ir &&
- type_size(ir->lhs->type) == 1) {
+ type_size(ir->lhs->type) == 1 &&
+ l.writemask == ((glsl_to_tgsi_instruction *)this->instructions.get_tail())->dst.writemask) {
/* To avoid emitting an extra MOV when assigning an expression to a
* variable, emit the last instruction of the expression again, but
* replace the destination register with the target of the assignment.
* Dead code elimination will remove the original instruction.
*/
- glsl_to_tgsi_instruction *inst;
+ glsl_to_tgsi_instruction *inst, *new_inst;
inst = (glsl_to_tgsi_instruction *)this->instructions.get_tail();
- emit(ir, inst->op, l, inst->src[0], inst->src[1], inst->src[2]);
+ new_inst = emit(ir, inst->op, l, inst->src[0], inst->src[1], inst->src[2]);
+ new_inst->saturate = inst->saturate;
} else {
for (i = 0; i < type_size(ir->lhs->type); i++) {
emit(ir, TGSI_OPCODE_MOV, l, r);