aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-28 08:33:39 +0100
committermarha <marha@users.sourceforge.net>2011-11-28 08:33:39 +0100
commit7417e9a171736b5279881cd4381fb58c617a23d9 (patch)
treef5eefdba22232ed7549497c96e70f09ccf558988 /mesalib/src/mesa/swrast
parenta0b4a1330be6a36ad095222d2ea83927cd33514d (diff)
downloadvcxsrv-7417e9a171736b5279881cd4381fb58c617a23d9.tar.gz
vcxsrv-7417e9a171736b5279881cd4381fb58c617a23d9.tar.bz2
vcxsrv-7417e9a171736b5279881cd4381fb58c617a23d9.zip
mesa git update 28 nov 2011
Diffstat (limited to 'mesalib/src/mesa/swrast')
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch.c14
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch_tmp.h48
2 files changed, 62 insertions, 0 deletions
diff --git a/mesalib/src/mesa/swrast/s_texfetch.c b/mesalib/src/mesa/swrast/s_texfetch.c
index a854c3efd..bfa7da79d 100644
--- a/mesalib/src/mesa/swrast/s_texfetch.c
+++ b/mesalib/src/mesa/swrast/s_texfetch.c
@@ -165,6 +165,20 @@ texfetch_funcs[MESA_FORMAT_COUNT] =
store_texel_argb8888_rev
},
{
+ MESA_FORMAT_RGBX8888,
+ fetch_texel_1d_f_rgbx8888,
+ fetch_texel_2d_f_rgbx8888,
+ fetch_texel_3d_f_rgbx8888,
+ store_texel_rgbx8888
+ },
+ {
+ MESA_FORMAT_RGBX8888_REV,
+ fetch_texel_1d_f_rgbx8888_rev,
+ fetch_texel_2d_f_rgbx8888_rev,
+ fetch_texel_3d_f_rgbx8888_rev,
+ store_texel_rgbx8888_rev,
+ },
+ {
MESA_FORMAT_XRGB8888,
fetch_texel_1d_f_xrgb8888,
fetch_texel_2d_f_xrgb8888,
diff --git a/mesalib/src/mesa/swrast/s_texfetch_tmp.h b/mesalib/src/mesa/swrast/s_texfetch_tmp.h
index 8b7e930f9..4ee05a5ea 100644
--- a/mesalib/src/mesa/swrast/s_texfetch_tmp.h
+++ b/mesalib/src/mesa/swrast/s_texfetch_tmp.h
@@ -646,6 +646,54 @@ static void store_texel_argb8888_rev(struct swrast_texture_image *texImage,
#endif
+/* MESA_FORMAT_RGBX8888 ******************************************************/
+
+/* Fetch texel from 1D, 2D or 3D rgbx8888 texture, return 4 GLfloats */
+static void FETCH(f_rgbx8888)( const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel )
+{
+ const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+ texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24) );
+ texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
+ texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
+ texel[ACOMP] = 1.0f;
+}
+
+#if DIM == 3
+static void store_texel_rgbx8888(struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, const void *texel)
+{
+ const GLubyte *rgba = (const GLubyte *) texel;
+ GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+ *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], 0xff);
+}
+#endif
+
+
+/* MESA_FORMAT_RGBX888_REV ***************************************************/
+
+/* Fetch texel from 1D, 2D or 3D rgbx8888_rev texture, return 4 GLchans */
+static void FETCH(f_rgbx8888_rev)( const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel )
+{
+ const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+ texel[RCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff );
+ texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff );
+ texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
+ texel[ACOMP] = 1.0f;
+}
+
+#if DIM == 3
+static void store_texel_rgbx8888_rev(struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, const void *texel)
+{
+ const GLubyte *rgba = (const GLubyte *) texel;
+ GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+ *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], 0xff);
+}
+#endif
+
+
/* MESA_FORMAT_XRGB8888 ******************************************************/
/* Fetch texel from 1D, 2D or 3D xrgb8888 texture, return 4 GLchans */