Mesa (main): isl: Use CLAMP macro instead of MIN of MAX
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 3 21:35:47 UTC 2021
Module: Mesa
Branch: main
Commit: 9dfe7fbc6bbdb0e173e3abe099c2e4ffff23451b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9dfe7fbc6bbdb0e173e3abe099c2e4ffff23451b
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Mon Aug 2 17:56:40 2021 -0700
isl: Use CLAMP macro instead of MIN of MAX
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12177>
---
src/intel/isl/isl_format.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/intel/isl/isl_format.c b/src/intel/isl/isl_format.c
index bd9c63d140c..49e3ca58648 100644
--- a/src/intel/isl/isl_format.c
+++ b/src/intel/isl/isl_format.c
@@ -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:
More information about the mesa-commit
mailing list