etnaviv: Use SATURATE
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 19 May 2020 15:11:07 +0000 (11:11 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 26 May 2020 22:31:31 +0000 (22:31 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>

src/gallium/drivers/etnaviv/etnaviv_zsa.c

index 0684ab77a83a0826f6048967edfdd90d13ce7600..afff6b7d9c9271fae59d0a0d74bf39a414fa20a4 100644 (file)
@@ -98,7 +98,7 @@ etna_zsa_state_create(struct pipe_context *pctx,
    uint32_t extra_reference = 0;
 
    if (VIV_FEATURE(screen, chipMinorFeatures1, HALF_FLOAT))
-      extra_reference = util_float_to_half(CLAMP(so->alpha.ref_value, 0.0f, 1.0f));
+      extra_reference = util_float_to_half(SATURATE(so->alpha.ref_value));
 
    cs->PE_STENCIL_CONFIG_EXT =
       VIVS_PE_STENCIL_CONFIG_EXT_EXTRA_ALPHA_REF(extra_reference);