diff options
author | Abdiel Janulgue <[email protected]> | 2014-06-16 12:28:44 -0700 |
---|---|---|
committer | Abdiel Janulgue <[email protected]> | 2014-08-31 21:04:09 +0300 |
commit | b2c0c35907eb5f0b271b3d5a9799539a53cdfe20 (patch) | |
tree | 641e1e8d360d9ee89b1b95351bcab0084c14ebdf /src/mesa/program | |
parent | 7841a246b93d8d8aeb65df5805c0e9d05567c57e (diff) |
ir_to_mesa, glsl_to_tgsi: Remove try_emit_saturate
Now that saturate is implemented natively as instruction,
we can cut down on unneeded functionality.
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Signed-off-by: Abdiel Janulgue <[email protected]>
Diffstat (limited to 'src/mesa/program')
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index c6aae1a7033..49e4a7a40eb 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -311,7 +311,6 @@ public: int mul_operand); bool try_emit_mad_for_and_not(ir_expression *ir, int mul_operand); - bool try_emit_sat(ir_expression *ir); void emit_swz(ir_expression *ir); @@ -866,50 +865,6 @@ ir_to_mesa_visitor::try_emit_mad_for_and_not(ir_expression *ir, int try_operand) return true; } -bool -ir_to_mesa_visitor::try_emit_sat(ir_expression *ir) -{ - /* Saturates were only introduced to vertex programs in - * NV_vertex_program3, so don't give them to drivers in the VP. - */ - if (this->prog->Target == GL_VERTEX_PROGRAM_ARB) - return false; - - ir_rvalue *sat_src = ir->as_rvalue_to_saturate(); - if (!sat_src) - return false; - - sat_src->accept(this); - src_reg src = this->result; - - /* If we generated an expression instruction into a temporary in - * processing the saturate's operand, apply the saturate to that - * instruction. Otherwise, generate a MOV to do the saturate. - * - * Note that we have to be careful to only do this optimization if - * the instruction in question was what generated src->result. For - * example, ir_dereference_array might generate a MUL instruction - * to create the reladdr, and return us a src reg using that - * reladdr. That MUL result is not the value we're trying to - * saturate. - */ - ir_expression *sat_src_expr = sat_src->as_expression(); - ir_to_mesa_instruction *new_inst; - new_inst = (ir_to_mesa_instruction *)this->instructions.get_tail(); - if (sat_src_expr && (sat_src_expr->operation == ir_binop_mul || - sat_src_expr->operation == ir_binop_add || - sat_src_expr->operation == ir_binop_dot)) { - new_inst->saturate = true; - } else { - this->result = get_temp(ir->type); - ir_to_mesa_instruction *inst; - inst = emit(ir, OPCODE_MOV, dst_reg(this->result), src); - inst->saturate = true; - } - - return true; -} - void ir_to_mesa_visitor::reladdr_to_temp(ir_instruction *ir, src_reg *reg, int *num_reladdr) @@ -1072,9 +1027,6 @@ ir_to_mesa_visitor::visit(ir_expression *ir) return; } - if (try_emit_sat(ir)) - return; - if (ir->operation == ir_quadop_vector) { this->emit_swz(ir); return; |