struct gl_texture_object *texObj)
{
const struct gl_texture_image *srcImage;
- const struct gl_texture_format *convertFormat;
+ gl_format convertFormat;
const GLubyte *srcData = NULL;
GLubyte *dstData = NULL;
GLint level, maxLevels;
texObj->Target == GL_TEXTURE_CUBE_MAP_ARB);
if (srcImage->_BaseFormat == GL_RGB) {
- convertFormat = &_mesa_texformat_rgb;
+ convertFormat = MESA_FORMAT_RGB;
components = 3;
}
else if (srcImage->_BaseFormat == GL_RGBA) {
- convertFormat = &_mesa_texformat_rgba;
+ convertFormat = MESA_FORMAT_RGBA;
components = 4;
}
else {
}
else {
/* uncompressed */
- convertFormat = srcImage->TexFormat;
+ convertFormat = srcImage->TexFormat->MesaFormat;
}
_mesa_format_to_type_and_comps(convertFormat, &datatype, &comps);
if (dstImage->IsCompressed) {
GLubyte *temp;
/* compress image from dstData into dstImage->Data */
- const GLenum srcFormat = convertFormat->BaseFormat;
+ const GLenum srcFormat = _mesa_get_format_base_format(convertFormat);
GLint dstRowStride
= _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth);
const StoreTexImageFunc storeImage =
/**
- * Return datatype and number of components per texel for the
- * given gl_texture_format.
+ * Return datatype and number of components per texel for the given gl_format.
*/
void
-_mesa_format_to_type_and_comps(const struct gl_texture_format *format,
+_mesa_format_to_type_and_comps(gl_format format,
GLenum *datatype, GLuint *comps)
{
- switch (format->MesaFormat) {
+ switch (format) {
case MESA_FORMAT_RGBA8888:
case MESA_FORMAT_RGBA8888_REV:
case MESA_FORMAT_ARGB8888:
extern void
-_mesa_format_to_type_and_comps(const struct gl_texture_format *format,
+_mesa_format_to_type_and_comps(gl_format format,
GLenum *datatype, GLuint *comps);
extern FetchTexelFuncF
assert(target != GL_TEXTURE_3D); /* not done yet */
- _mesa_format_to_type_and_comps(texObj->Image[face][baseLevel]->TexFormat,
+ _mesa_format_to_type_and_comps(texObj->Image[face][baseLevel]->TexFormat->MesaFormat,
&datatype, &comps);
for (dstLevel = baseLevel + 1; dstLevel <= lastLevel; dstLevel++) {