summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-03-07 20:23:05 +0100
committerMarek Olšák <maraeo@gmail.com>2011-03-08 23:52:37 +0100
commitb0ec461954d87085cd31dfe92a9e13a4e5df5aa5 (patch)
tree8b37712e4096817f1d5e967e26e54d81bd95d15c /src/mesa/state_tracker
parent384845f335d1fbe6766673b988b23a003e104e7b (diff)
st/mesa: cleanup checking for signed compressed formats in generate_mipmaps
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index f8b23d11d0..899161e78f 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -204,14 +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 ||
- texObj->Image[face][baseLevel]->TexFormat == MESA_FORMAT_SIGNED_L_LATC1 ||
- texObj->Image[face][baseLevel]->TexFormat == MESA_FORMAT_SIGNED_LA_LATC2)
- 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 {