Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
#elif CHAN_BITS == 32
#define CHAN_TO_UBYTE(c) FLOAT_TO_UBYTE(c)
-#define CHAN_TO_USHORT(c) ((GLushort) (CLAMP((c), 0.0f, 1.0f) * 65535.0))
-#define CHAN_TO_SHORT(c) ((GLshort) (CLAMP((c), 0.0f, 1.0f) * 32767.0))
+#define CHAN_TO_USHORT(c) ((GLushort) (SATURATE((c)) * 65535.0))
+#define CHAN_TO_SHORT(c) ((GLshort) (SATURATE((c)) * 32767.0))
#define CHAN_TO_FLOAT(c) (c)
#define CLAMPED_FLOAT_TO_CHAN(c, f) c = (f)
const GLdouble depthMaxF = ctx->DrawBuffer->_DepthMaxF;
for (i = 0; i < width; i++) {
GLdouble d = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias;
- d = CLAMP(d, 0.0, 1.0) * depthMaxF;
+ d = SATURATE(d) * depthMaxF;
if (d >= depthMaxF)
z[i] = depthMax;
else