summaryrefslogtreecommitdiff
path: root/src/mesa/main/imports.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/imports.h')
-rw-r--r--src/mesa/main/imports.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 042147fd8b..ad7af5c1d8 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -151,6 +151,13 @@ static inline int IROUND(float f)
return (int) ((f >= 0.0F) ? (f + 0.5F) : (f - 0.5F));
}
+/**
+ * Convert double to int by rounding to nearest integer, away from zero.
+ */
+static inline int IROUNDD(double d)
+{
+ return (int) ((d >= 0.0) ? (d + 0.5) : (d - 0.5));
+}
/**
* Convert float to int64 by rounding to nearest integer.