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");
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];
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");
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];
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");
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];
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");
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];
#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];
}
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];
}
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];
}
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];
_mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS);
extern 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);
extern 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);
extern 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);
extern 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);
extern 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);
extern 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);
extern 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);
extern 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);
extern void
_mesa_init_texture_s3tc(struct gl_context *ctx);
},
{
MESA_FORMAT_SRGB_DXT1,
- NULL,
- _mesa_fetch_texel_2d_f_srgb_dxt1,
- NULL
+ _mesa_fetch_texel_srgb_dxt1,
+ _mesa_fetch_texel_srgb_dxt1,
+ _mesa_fetch_texel_srgb_dxt1
},
{
MESA_FORMAT_SRGBA_DXT1,
- NULL,
- _mesa_fetch_texel_2d_f_srgba_dxt1,
- NULL
+ _mesa_fetch_texel_srgba_dxt1,
+ _mesa_fetch_texel_srgba_dxt1,
+ _mesa_fetch_texel_srgba_dxt1
},
{
MESA_FORMAT_SRGBA_DXT3,
- NULL,
- _mesa_fetch_texel_2d_f_srgba_dxt3,
- NULL
+ _mesa_fetch_texel_srgba_dxt3,
+ _mesa_fetch_texel_srgba_dxt3,
+ _mesa_fetch_texel_srgba_dxt3
},
{
MESA_FORMAT_SRGBA_DXT5,
- NULL,
- _mesa_fetch_texel_2d_f_srgba_dxt5,
- NULL
+ _mesa_fetch_texel_srgba_dxt5,
+ _mesa_fetch_texel_srgba_dxt5,
+ _mesa_fetch_texel_srgba_dxt5
},
{
},
{
MESA_FORMAT_RGB_DXT1,
- NULL,
- _mesa_fetch_texel_2d_f_rgb_dxt1,
- NULL
+ _mesa_fetch_texel_rgb_dxt1,
+ _mesa_fetch_texel_rgb_dxt1,
+ _mesa_fetch_texel_rgb_dxt1
},
{
MESA_FORMAT_RGBA_DXT1,
- NULL,
- _mesa_fetch_texel_2d_f_rgba_dxt1,
- NULL
+ _mesa_fetch_texel_rgba_dxt1,
+ _mesa_fetch_texel_rgba_dxt1,
+ _mesa_fetch_texel_rgba_dxt1
},
{
MESA_FORMAT_RGBA_DXT3,
- NULL,
- _mesa_fetch_texel_2d_f_rgba_dxt3,
- NULL
+ _mesa_fetch_texel_rgba_dxt3,
+ _mesa_fetch_texel_rgba_dxt3,
+ _mesa_fetch_texel_rgba_dxt3
},
{
MESA_FORMAT_RGBA_DXT5,
- NULL,
- _mesa_fetch_texel_2d_f_rgba_dxt5,
- NULL
+ _mesa_fetch_texel_rgba_dxt5,
+ _mesa_fetch_texel_rgba_dxt5,
+ _mesa_fetch_texel_rgba_dxt5
},
{
MESA_FORMAT_RGBA_FLOAT32,