1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Compatibility: Set GL_TEXTURE_MAX_LEVEL to the number of mipmaps

This commit is contained in:
BlueCube3310
2025-07-11 20:11:58 +02:00
parent a4607f4522
commit 542d805508

View File

@@ -280,10 +280,10 @@ struct Texture {
max_lod = 0;
} else if (config->use_nearest_mip_filter) {
pmin = GL_NEAREST_MIPMAP_NEAREST;
max_lod = 1000;
max_lod = mipmaps - 1;
} else {
pmin = GL_NEAREST_MIPMAP_LINEAR;
max_lod = 1000;
max_lod = mipmaps - 1;
}
} break;
case RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: {
@@ -297,10 +297,10 @@ struct Texture {
max_lod = 0;
} else if (config->use_nearest_mip_filter) {
pmin = GL_LINEAR_MIPMAP_NEAREST;
max_lod = 1000;
max_lod = mipmaps - 1;
} else {
pmin = GL_LINEAR_MIPMAP_LINEAR;
max_lod = 1000;
max_lod = mipmaps - 1;
}
} break;
default: {