From 542d8055081cbed3d4e9b86a7413b185af30f946 Mon Sep 17 00:00:00 2001 From: BlueCube3310 <53150244+BlueCube3310@users.noreply.github.com> Date: Fri, 11 Jul 2025 20:11:58 +0200 Subject: [PATCH] Compatibility: Set `GL_TEXTURE_MAX_LEVEL` to the number of mipmaps --- drivers/gles3/storage/texture_storage.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gles3/storage/texture_storage.h b/drivers/gles3/storage/texture_storage.h index 8ec9b3d369c..a77c361df8c 100644 --- a/drivers/gles3/storage/texture_storage.h +++ b/drivers/gles3/storage/texture_storage.h @@ -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: {