summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/mipmap.c10
-rw-r--r--src/mesa/main/texformat.c7
-rw-r--r--src/mesa/main/texformat.h2
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c2
4 files changed, 10 insertions, 11 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index faa6c47cb78..0950d8abea1 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -1495,7 +1495,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
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;
@@ -1521,11 +1521,11 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
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 {
@@ -1561,7 +1561,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
}
else {
/* uncompressed */
- convertFormat = srcImage->TexFormat;
+ convertFormat = srcImage->TexFormat->MesaFormat;
}
_mesa_format_to_type_and_comps(convertFormat, &datatype, &comps);
@@ -1664,7 +1664,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target,
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 =
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index dae98bcc6f7..60b2065a6c8 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -1351,14 +1351,13 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
/**
- * 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:
diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h
index 39d5ec640a4..638eadff971 100644
--- a/src/mesa/main/texformat.h
+++ b/src/mesa/main/texformat.h
@@ -151,7 +151,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
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
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index 58f69336523..63a6956a7a9 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -115,7 +115,7 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
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++) {