summaryrefslogtreecommitdiffstats
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.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index a928b20ad56..b69b5fa31a1 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -198,6 +198,20 @@ extern void _ext_mesa_free_pixelbuffer( void *pb );
/*@}*/
+/**********************************************************************/
+
+
+/**
+ * Sometimes we treat GLfloats as GLints. On x86 systems, moving a float
+ * as a int (thereby using integer registers instead of FP registers) is
+ * a performance win. Typically, this can be done with ordinary casts.
+ * But with gcc's -fstrict-aliasing flag (which defaults to on in gcc 3.0)
+ * these casts generate warnings.
+ * The following union typedef is used to solve that.
+ */
+typedef union { GLfloat f; GLint i; } fi_type;
+
+
/**********************************************************************
* Math macros