summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texfetch_tmp.h
diff options
context:
space:
mode:
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 0951f86b7ba..0b69b69add5 100644
--- a/src/mesa/main/texfetch_tmp.h
+++ b/src/mesa/main/texfetch_tmp.h
@@ -1244,6 +1244,30 @@ static void store_texel_i8(struct gl_texture_image *texImage,
#endif
+/* MESA_FORMAT_I16 ***********************************************************/
+
+/* Fetch texel from 1D, 2D or 3D i16 texture, return 4 GLchans */
+static void FETCH(f_i16)( 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] =
+ texel[ACOMP] = USHORT_TO_FLOAT( src[0] );
+}
+
+#if DIM == 3
+static void store_texel_i16(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[RCOMP];
+}
+#endif
+
+
/* MESA_FORMAT_CI8 ***********************************************************/
/* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a