mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 20:50:09 +01:00
glsl: Fix DIV_TO_MUL_RCP lowering for uint result types.
f2i results in an int/ivec; we need i2u to get a uint/uvec. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
8eb9753944
commit
ed92b91212
1 changed files with 7 additions and 2 deletions
|
|
@ -168,8 +168,13 @@ lower_instructions_visitor::div_to_mul_rcp(ir_expression *ir)
|
|||
|
||||
op0 = new(ir) ir_expression(ir_binop_mul, vec_type, op0, op1);
|
||||
|
||||
ir->operation = ir_unop_f2i;
|
||||
ir->operands[0] = op0;
|
||||
if (ir->operands[1]->type->base_type == GLSL_TYPE_INT) {
|
||||
ir->operation = ir_unop_f2i;
|
||||
ir->operands[0] = op0;
|
||||
} else {
|
||||
ir->operation = ir_unop_i2u;
|
||||
ir->operands[0] = new(ir) ir_expression(ir_unop_f2i, op0);
|
||||
}
|
||||
ir->operands[1] = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue