[Mesa-dev] [PATCH] st/mesa: add comment to explain _min(), _maxf(), etc. functions

Brian Paul brianp at vmware.com
Tue Feb 25 08:54:20 PST 2014


---
 src/mesa/state_tracker/st_extensions.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 47b975b..727fb1a 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -39,6 +39,12 @@
 #include "st_extensions.h"
 #include "st_format.h"
 
+
+/*
+ * Note: we use these function rather than the MIN2, MAX2, CLAMP macros to
+ * avoid evaluating arguments (which are often function calls) more than once.
+ */
+
 static unsigned _min(unsigned a, unsigned b)
 {
    return (a < b) ? a : b;
-- 
1.7.10.4



More information about the mesa-dev mailing list