From f81bb3160c5f39d8f7ad329e99865af88f02b96a Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 10 Mar 2011 09:49:29 +0000 Subject: xserver mesa git update 10 Mar 2011 --- mesalib/src/mesa/state_tracker/st_gen_mipmap.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'mesalib/src/mesa/state_tracker/st_gen_mipmap.c') diff --git a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c index a12a32e11..899161e78 100644 --- a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c +++ b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c @@ -204,12 +204,10 @@ fallback_generate_mipmap(struct gl_context *ctx, GLenum target, _mesa_is_format_compressed(texObj->Image[face][baseLevel]->TexFormat); if (compressed) { - if (texObj->Image[face][baseLevel]->TexFormat == MESA_FORMAT_SIGNED_RED_RGTC1 || - texObj->Image[face][baseLevel]->TexFormat == MESA_FORMAT_SIGNED_RG_RGTC2) - datatype = GL_FLOAT; - else - datatype = GL_UNSIGNED_BYTE; - + GLenum type = + _mesa_get_format_datatype(texObj->Image[face][baseLevel]->TexFormat); + + datatype = type == GL_UNSIGNED_NORMALIZED ? GL_UNSIGNED_BYTE : GL_FLOAT; comps = 4; } else { -- cgit v1.2.3