summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/mipmap.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2014-07-25 17:38:22 +0100
committerNeil Roberts <neil@linux.intel.com>2014-08-12 18:23:50 +0100
commit88a8830390c8c7557d2e852dcef94ae6f04eb6b5 (patch)
tree1f001e59cf5d38f0a924ad3db746c59f0bc7cccc /src/mesa/main/mipmap.c
parent17cde55c538009764207bd29b78a909d2c5d14b4 (diff)
downloadexternal_mesa3d-88a8830390c8c7557d2e852dcef94ae6f04eb6b5.zip
external_mesa3d-88a8830390c8c7557d2e852dcef94ae6f04eb6b5.tar.gz
external_mesa3d-88a8830390c8c7557d2e852dcef94ae6f04eb6b5.tar.bz2
mesa/main: Modify generate_mipmap_compressed to cope with float textures
Once we add BPTC texture support we will need to generate mipmaps for compressed floating point textures too. Most of the code seems to already be there but it just needs a few extra lines to get it to use GL_FLOAT instead of GL_UNSIGNED_BYTE as the type for the temporary buffers. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/mipmap.c')
-rw-r--r--src/mesa/main/mipmap.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index cc109cc..fdaa682 100644
--- a/src/mesa/main/mipmap.c
+++ b/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;
}