aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texcompress_s3tc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-27 08:17:50 +0200
committermarha <marha@users.sourceforge.net>2012-09-04 14:23:00 +0200
commit02b914d3b9b658a16e17cf2d95deede75dbbacc9 (patch)
tree3757711ab3e1db8e1b59877354096503d9635112 /mesalib/src/mesa/main/texcompress_s3tc.c
parentf479a5fc7f844d96b169c399cb1e8ac085de6c2b (diff)
downloadvcxsrv-02b914d3b9b658a16e17cf2d95deede75dbbacc9.tar.gz
vcxsrv-02b914d3b9b658a16e17cf2d95deede75dbbacc9.tar.bz2
vcxsrv-02b914d3b9b658a16e17cf2d95deede75dbbacc9.zip
xwininfo fontconfig libX11 libXau libXext libxcb mesa pixman
xkeyboard-config git update 27 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/main/texcompress_s3tc.c')
-rw-r--r--mesalib/src/mesa/main/texcompress_s3tc.c60
1 files changed, 32 insertions, 28 deletions
diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c
index 632c05873..c1984da66 100644
--- a/mesalib/src/mesa/main/texcompress_s3tc.c
+++ b/mesalib/src/mesa/main/texcompress_s3tc.c
@@ -372,13 +372,14 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
static void
-fetch_texel_2d_rgb_dxt1( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLubyte *texel )
+fetch_texel_2d_rgb_dxt1(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLubyte *texel)
{
(void) k;
if (fetch_ext_rgb_dxt1) {
+ GLint sliceOffset = k ? texImage->ImageOffsets[k] / 2 : 0;
fetch_ext_rgb_dxt1(texImage->RowStride,
- texImage->Map, i, j, texel);
+ texImage->Map + sliceOffset, i, j, texel);
}
else
_mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgb_dxt1");
@@ -386,8 +387,8 @@ fetch_texel_2d_rgb_dxt1( const struct swrast_texture_image *texImage,
void
-_mesa_fetch_texel_2d_f_rgb_dxt1(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
+_mesa_fetch_texel_rgb_dxt1(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
{
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];
@@ -400,13 +401,14 @@ _mesa_fetch_texel_2d_f_rgb_dxt1(const struct swrast_texture_image *texImage,
static void
-fetch_texel_2d_rgba_dxt1( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLubyte *texel )
+fetch_texel_2d_rgba_dxt1(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLubyte *texel)
{
(void) k;
if (fetch_ext_rgba_dxt1) {
+ GLint sliceOffset = k ? texImage->ImageOffsets[k] / 2 : 0;
fetch_ext_rgba_dxt1(texImage->RowStride,
- texImage->Map, i, j, texel);
+ texImage->Map + sliceOffset, i, j, texel);
}
else
_mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt1\n");
@@ -414,8 +416,8 @@ fetch_texel_2d_rgba_dxt1( const struct swrast_texture_image *texImage,
void
-_mesa_fetch_texel_2d_f_rgba_dxt1(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
+_mesa_fetch_texel_rgba_dxt1(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
{
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];
@@ -428,13 +430,14 @@ _mesa_fetch_texel_2d_f_rgba_dxt1(const struct swrast_texture_image *texImage,
static void
-fetch_texel_2d_rgba_dxt3( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLubyte *texel )
+fetch_texel_2d_rgba_dxt3(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLubyte *texel)
{
(void) k;
if (fetch_ext_rgba_dxt3) {
+ GLint sliceOffset = k ? texImage->ImageOffsets[k] : 0;
fetch_ext_rgba_dxt3(texImage->RowStride,
- texImage->Map, i, j, texel);
+ texImage->Map + sliceOffset, i, j, texel);
}
else
_mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt3\n");
@@ -442,8 +445,8 @@ fetch_texel_2d_rgba_dxt3( const struct swrast_texture_image *texImage,
void
-_mesa_fetch_texel_2d_f_rgba_dxt3(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
+_mesa_fetch_texel_rgba_dxt3(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
{
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];
@@ -456,13 +459,14 @@ _mesa_fetch_texel_2d_f_rgba_dxt3(const struct swrast_texture_image *texImage,
static void
-fetch_texel_2d_rgba_dxt5( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLubyte *texel )
+fetch_texel_2d_rgba_dxt5(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLubyte *texel)
{
(void) k;
if (fetch_ext_rgba_dxt5) {
+ GLint sliceOffset = k ? texImage->ImageOffsets[k] : 0;
fetch_ext_rgba_dxt5(texImage->RowStride,
- texImage->Map, i, j, texel);
+ texImage->Map + sliceOffset, i, j, texel);
}
else
_mesa_debug(NULL, "attempted to decode s3tc texture without library available: fetch_texel_2d_rgba_dxt5\n");
@@ -470,8 +474,8 @@ fetch_texel_2d_rgba_dxt5( const struct swrast_texture_image *texImage,
void
-_mesa_fetch_texel_2d_f_rgba_dxt5(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
+_mesa_fetch_texel_rgba_dxt5(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
{
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];
@@ -484,8 +488,8 @@ _mesa_fetch_texel_2d_f_rgba_dxt5(const struct swrast_texture_image *texImage,
#if FEATURE_EXT_texture_sRGB
void
-_mesa_fetch_texel_2d_f_srgb_dxt1( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
+_mesa_fetch_texel_srgb_dxt1(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
{
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];
@@ -497,8 +501,8 @@ _mesa_fetch_texel_2d_f_srgb_dxt1( const struct swrast_texture_image *texImage,
}
void
-_mesa_fetch_texel_2d_f_srgba_dxt1(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
+_mesa_fetch_texel_srgba_dxt1(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
{
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];
@@ -510,8 +514,8 @@ _mesa_fetch_texel_2d_f_srgba_dxt1(const struct swrast_texture_image *texImage,
}
void
-_mesa_fetch_texel_2d_f_srgba_dxt3(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
+_mesa_fetch_texel_srgba_dxt3(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
{
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];
@@ -523,8 +527,8 @@ _mesa_fetch_texel_2d_f_srgba_dxt3(const struct swrast_texture_image *texImage,
}
void
-_mesa_fetch_texel_2d_f_srgba_dxt5(const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel)
+_mesa_fetch_texel_srgba_dxt5(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel)
{
/* just sample as GLubyte and convert to float here */
GLubyte rgba[4];