summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texformat_tmp.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/texformat_tmp.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/texformat_tmp.h')
-rw-r--r--src/mesa/main/texformat_tmp.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h
index 275340cabd3..f9f9d5b1f8e 100644
--- a/src/mesa/main/texformat_tmp.h
+++ b/src/mesa/main/texformat_tmp.h
@@ -1269,7 +1269,7 @@ static void FETCH(sl8)(const struct gl_texture_image *texImage,
texel[RCOMP] =
texel[GCOMP] =
texel[BCOMP] = nonlinear_to_linear(src[0]);
- texel[ACOMP] = CHAN_MAX;
+ texel[ACOMP] = 1.0F;
}
#if DIM == 3
@@ -1308,7 +1308,22 @@ static void store_texel_sla8(struct gl_texture_image *texImage,
#endif /* FEATURE_EXT_texture_sRGB */
+#if DIM == 2
+/* MESA_FORMAT_DUDV8 ********************************************************/
+
+/* this format by definition produces 0,0,0,1 as rgba values,
+ however we'll return the dudv values as rg and fix up elsewhere */
+static void FETCH(dudv8)(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel )
+{
+ const GLbyte *src = TEXEL_ADDR(GLbyte, texImage, i, j, k, 2);
+ texel[RCOMP] = BYTE_TO_FLOAT(src[0]);
+ texel[GCOMP] = BYTE_TO_FLOAT(src[1]);
+ texel[BCOMP] = 0;
+ texel[ACOMP] = 0;
+}
+#endif
/* MESA_FORMAT_YCBCR *********************************************************/