summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/macros.h
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2009-03-12 15:01:16 +0100
committerRoland Scheidegger <[email protected]>2009-03-12 15:01:16 +0100
commit114152e068ec919feb0a57a1259c2ada970b9f02 (patch)
treef424d1c9f88ddf36c94991906879f3a71ca1c36a /src/mesa/main/macros.h
parentb7d841b59e9087c0ba8c2726897ab1506375e4e6 (diff)
mesa: add support for ATI_envmap_bumpmap
add new entrypoints, new texture format, etc translate in texenvprogram.c for drivers using the mesa-generated tex env fragment program also handled in swrast, but not tested (cannot work due to negative texel results not handled correctly)
Diffstat (limited to 'src/mesa/main/macros.h')
-rw-r--r--src/mesa/main/macros.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index 2630855a0ea..bfd740870ec 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -54,13 +54,16 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256];
#define FLOAT_TO_BYTE(X) ( (((GLint) (255.0F * (X))) - 1) / 2 )
-/** Convert GLushort in [0,65536] to GLfloat in [0.0,1.0] */
+/** Convert GLushort in [0,65535] to GLfloat in [0.0,1.0] */
#define USHORT_TO_FLOAT(S) ((GLfloat) (S) * (1.0F / 65535.0F))
+/** Convert GLfloat in [0.0,1.0] to GLushort in [0, 65535] */
+#define FLOAT_TO_USHORT(X) ((GLuint) ((X) * 65535.0))
+
/** Convert GLshort in [-32768,32767] to GLfloat in [-1.0,1.0] */
#define SHORT_TO_FLOAT(S) ((2.0F * (S) + 1.0F) * (1.0F/65535.0F))
-/** Convert GLfloat in [0.0,1.0] to GLshort in [-32768,32767] */
+/** Convert GLfloat in [-1.0,1.0] to GLshort in [-32768,32767] */
#define FLOAT_TO_SHORT(X) ( (((GLint) (65535.0F * (X))) - 1) / 2 )