From: Alyssa Rosenzweig Date: Tue, 19 May 2020 15:14:12 +0000 (-0400) Subject: glsl: Use SATURATE X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=82996a8cff79aa8acc700cd45c933635e59bdedb;p=mesa.git glsl: Use SATURATE Signed-off-by: Alyssa Rosenzweig Reviewed-by: Eric Engestrom Part-of: --- diff --git a/src/compiler/glsl/ir_constant_expression.cpp b/src/compiler/glsl/ir_constant_expression.cpp index 33b097aafd4..f4974210843 100644 --- a/src/compiler/glsl/ir_constant_expression.cpp +++ b/src/compiler/glsl/ir_constant_expression.cpp @@ -340,7 +340,7 @@ pack_unorm_1x8(float x) * * packUnorm4x8: round(clamp(c, 0, +1) * 255.0) */ - return (uint8_t) (int) _mesa_roundevenf(CLAMP(x, 0.0f, 1.0f) * 255.0f); + return (uint8_t) (int) _mesa_roundevenf(SATURATE(x) * 255.0f); } /** @@ -359,7 +359,7 @@ pack_unorm_1x16(float x) * packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) */ return (uint16_t) (int) - _mesa_roundevenf(CLAMP(x, 0.0f, 1.0f) * 65535.0f); + _mesa_roundevenf(SATURATE(x) * 65535.0f); } /**