summaryrefslogtreecommitdiff
path: root/src/mesa/main/texfetch_tmp.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-05-09 19:28:10 -0600
committerBrian Paul <brianp@vmware.com>2010-05-09 21:19:42 -0600
commit17e96718946486ef77927fcf3bb299d8bff32b98 (patch)
treea906df83adb97e08089023a1c48c36fa81c817bc /src/mesa/main/texfetch_tmp.h
parent7a57af6d11a8fae9838a0d2e42eac6200b8f027e (diff)
mesa: added unsigned 16-bit/channel tex format
Diffstat (limited to 'src/mesa/main/texfetch_tmp.h')
-rw-r--r--src/mesa/main/texfetch_tmp.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h
index 4df2b19181..280c8d9400 100644
--- a/src/mesa/main/texfetch_tmp.h
+++ b/src/mesa/main/texfetch_tmp.h
@@ -1374,7 +1374,7 @@ store_texel_signed_rg_16(struct gl_texture_image *texImage,
#endif
-/* MESA_FORMAT_SIGNED_RGB_16 ***********************************************/
+/* MESA_FORMAT_SIGNED_RGBA_16 ***********************************************/
static void
FETCH(signed_rgb_16)(const struct gl_texture_image *texImage,
@@ -1430,6 +1430,35 @@ store_texel_signed_rgba_16(struct gl_texture_image *texImage,
+/* MESA_FORMAT_RGBA_16 ***********************************************/
+
+static void
+FETCH(rgba_16)(const struct gl_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ const GLushort *s = TEXEL_ADDR(GLushort, texImage, i, j, k, 4);
+ texel[RCOMP] = USHORT_TO_FLOAT( s[0] );
+ texel[GCOMP] = USHORT_TO_FLOAT( s[1] );
+ texel[BCOMP] = USHORT_TO_FLOAT( s[2] );
+ texel[ACOMP] = USHORT_TO_FLOAT( s[3] );
+}
+
+#if DIM == 3
+static void
+store_texel_rgba_16(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, 4);
+ dst[0] = rgba[RCOMP];
+ dst[1] = rgba[GCOMP];
+ dst[2] = rgba[BCOMP];
+ dst[3] = rgba[ACOMP];
+}
+#endif
+
+
+
/* MESA_FORMAT_YCBCR *********************************************************/
/* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLfloats.