mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-03 19:10:34 +01:00
glsl: Implement saturate as ir_unop_saturate
Now that we have the ir_unop_saturate implemented as a single instruction, generate the correct simplified expression. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
This commit is contained in:
parent
cb621166dc
commit
cbd0d643a3
1 changed files with 1 additions and 5 deletions
|
|
@ -271,11 +271,7 @@ clamp(operand a, operand b, operand c)
|
|||
ir_expression *
|
||||
saturate(operand a)
|
||||
{
|
||||
void *mem_ctx = ralloc_parent(a.val);
|
||||
|
||||
return expr(ir_binop_max,
|
||||
expr(ir_binop_min, a, new(mem_ctx) ir_constant(1.0f)),
|
||||
new(mem_ctx) ir_constant(0.0f));
|
||||
return expr(ir_unop_saturate, a);
|
||||
}
|
||||
|
||||
ir_expression *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue