handle both old- and new-style mipmap generation

This commit is contained in:
milek7
2021-01-22 22:35:37 +01:00
parent 63edbe91c2
commit 7422dddd02

View File

@@ -1004,6 +1004,10 @@ opengl_texture::create( bool const Static ) {
auto blocksize_it = precompressed_formats.find(internal_format);
if ( data_mapcount == 1 && !glGenerateMipmap ) {
glTexParameteri(target, GL_GENERATE_MIPMAP, GL_TRUE);
}
for( int maplevel = 0; maplevel < data_mapcount; ++maplevel ) {
if (blocksize_it != precompressed_formats.end())
@@ -1034,8 +1038,7 @@ opengl_texture::create( bool const Static ) {
}
}
if( data_mapcount == 1 ) {
// fill missing mipmaps if needed
if ( data_mapcount == 1 && glGenerateMipmap ) {
glGenerateMipmap(target);
}