summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texfetch_tmp.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-12-22 00:32:33 +0100
committerMarek Olšák <[email protected]>2010-12-23 16:54:58 +0100
commiteb31837a0d4fa4fe115bb288ddb37cbedea954ae (patch)
treede384dba7f46628e6a9d24900ce3c030b7067989 /src/mesa/main/texfetch_tmp.h
parentbae9d511f343c7bd5eb66d1d1d18d32b47e738e3 (diff)
mesa: implement new texture format A16
Diffstat (limited to 'src/mesa/main/texfetch_tmp.h')
-rw-r--r--src/mesa/main/texfetch_tmp.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h
index b6ffdd09f94..3a75cdcefe9 100644
--- a/src/mesa/main/texfetch_tmp.h
+++ b/src/mesa/main/texfetch_tmp.h
@@ -1148,6 +1148,30 @@ static void store_texel_a8(struct gl_texture_image *texImage,
#endif
+/* MESA_FORMAT_A16 ************************************************************/
+
+/* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */
+static void FETCH(f_a16)( const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel )
+{
+ const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
+ texel[RCOMP] =
+ texel[GCOMP] =
+ texel[BCOMP] = 0.0F;
+ texel[ACOMP] = USHORT_TO_FLOAT( src[0] );
+}
+
+#if DIM == 3
+static void store_texel_a16(struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, const void *texel)
+{
+ const GLushort *rgba = (const GLushort *) texel;
+ GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
+ *dst = rgba[ACOMP];
+}
+#endif
+
+
/* MESA_FORMAT_L8 ************************************************************/
/* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */