aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/mipmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/mipmap.c')
-rw-r--r--mesalib/src/mesa/main/mipmap.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c
index cc109cc52..fdaa68282 100644
--- a/mesalib/src/mesa/main/mipmap.c
+++ b/mesalib/src/mesa/main/mipmap.c
@@ -2038,12 +2038,15 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
components = _mesa_format_num_components(temp_format);
- /* Revisit this if we get compressed formats with >8 bits per component */
- if (_mesa_get_format_datatype(srcImage->TexFormat)
- == GL_SIGNED_NORMALIZED) {
+ switch (_mesa_get_format_datatype(srcImage->TexFormat)) {
+ case GL_FLOAT:
+ temp_datatype = GL_FLOAT;
+ break;
+ case GL_SIGNED_NORMALIZED:
+ /* Revisit this if we get compressed formats with >8 bits per component */
temp_datatype = GL_BYTE;
- }
- else {
+ break;
+ default:
temp_datatype = GL_UNSIGNED_BYTE;
}