mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
handle both old- and new-style mipmap generation
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user