Skip to content

Commit 542d805

Browse files
committed
Compatibility: Set GL_TEXTURE_MAX_LEVEL to the number of mipmaps
1 parent a4607f4 commit 542d805

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gles3/storage/texture_storage.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ struct Texture {
280280
max_lod = 0;
281281
} else if (config->use_nearest_mip_filter) {
282282
pmin = GL_NEAREST_MIPMAP_NEAREST;
283-
max_lod = 1000;
283+
max_lod = mipmaps - 1;
284284
} else {
285285
pmin = GL_NEAREST_MIPMAP_LINEAR;
286-
max_lod = 1000;
286+
max_lod = mipmaps - 1;
287287
}
288288
} break;
289289
case RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: {
@@ -297,10 +297,10 @@ struct Texture {
297297
max_lod = 0;
298298
} else if (config->use_nearest_mip_filter) {
299299
pmin = GL_LINEAR_MIPMAP_NEAREST;
300-
max_lod = 1000;
300+
max_lod = mipmaps - 1;
301301
} else {
302302
pmin = GL_LINEAR_MIPMAP_LINEAR;
303-
max_lod = 1000;
303+
max_lod = mipmaps - 1;
304304
}
305305
} break;
306306
default: {

0 commit comments

Comments
 (0)