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

Merge pull request #108528 from BlueCube3310/compat-mip-limit

Compatibility: Set `GL_TEXTURE_MAX_LEVEL` to the number of mipmaps
This commit is contained in:
Thaddeus Crews
2025-10-23 15:33:59 -05:00

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: {