summaryrefslogtreecommitdiff
path: root/src/mesa/main/macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/macros.h')
-rw-r--r--src/mesa/main/macros.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index 5228c3a8f28..886e0cdf1c4 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -184,6 +184,13 @@ static inline GLfloat UINT_AS_FLT(GLuint u)
return tmp.f;
}
+static inline unsigned FLT_AS_UINT(float f)
+{
+ fi_type tmp;
+ tmp.f = f;
+ return tmp.u;
+}
+
/**
* Convert a floating point value to an unsigned fixed point value.
*