isl: Use CLAMP macro instead of MIN of MAX

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12177>
This commit is contained in:
Ian Romanick 2021-08-02 17:56:40 -07:00
parent 72259a870f
commit 9dfe7fbc6b

View file

@ -1191,8 +1191,8 @@ pack_channel(const union isl_color_value *value, unsigned i,
packed = MIN(value->u32[i], u_uintN_max(layout->bits));
break;
case ISL_SINT:
packed = MIN(MAX(value->u32[i], u_intN_min(layout->bits)),
u_intN_max(layout->bits));
packed = CLAMP(value->u32[i], u_intN_min(layout->bits),
u_intN_max(layout->bits));
break;
default: