mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 21:20:12 +01:00
glsl: Add constant evaluation of ir_unop_saturate
v2: Use CLAMP macro (Ian Romanick) Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
a5f02b6696
commit
4c0ccfc5b3
1 changed files with 6 additions and 0 deletions
|
|
@ -1469,6 +1469,12 @@ ir_expression::constant_expression_value(struct hash_table *variable_context)
|
|||
}
|
||||
break;
|
||||
|
||||
case ir_unop_saturate:
|
||||
for (unsigned c = 0; c < components; c++) {
|
||||
data.f[c] = CLAMP(op[0]->value.f[c], 0.0f, 1.0f);
|
||||
}
|
||||
break;
|
||||
|
||||
case ir_triop_bitfield_extract: {
|
||||
int offset = op[1]->value.i[0];
|
||||
int bits = op[2]->value.i[0];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue