diff options
| author | Yuri Sizov <yuris@humnom.net> | 2023-07-21 17:15:39 +0200 |
|---|---|---|
| committer | Yuri Sizov <yuris@humnom.net> | 2023-07-21 17:15:39 +0200 |
| commit | 4acb8c66a1eb2cde8a0b78cbdb38fe13de9beab1 (patch) | |
| tree | 2154b93ae8946557a958bd89389298085aa67b51 | |
| parent | 15c0e403750ef5fa21b1bf83420912c22940f1f6 (diff) | |
| parent | 90f0e97eb92c002991242f6899f50ac2345d85f6 (diff) | |
| download | redot-engine-4acb8c66a1eb2cde8a0b78cbdb38fe13de9beab1.tar.gz | |
Merge pull request #79568 from LRFLEW/glaniso
GLES3: Reset anisotropic filtering when changing texture filtering mode
| -rw-r--r-- | drivers/gles3/storage/texture_storage.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gles3/storage/texture_storage.h b/drivers/gles3/storage/texture_storage.h index fefcd56570..e6f732e4fe 100644 --- a/drivers/gles3/storage/texture_storage.h +++ b/drivers/gles3/storage/texture_storage.h @@ -255,7 +255,7 @@ struct Texture { GLenum pmin = GL_NEAREST; // param min GLenum pmag = GL_NEAREST; // param mag GLint max_lod = 1000; - bool use_anisotropy = false; + float anisotropy = 1.0f; switch (state_filter) { case RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST: { pmin = GL_NEAREST; @@ -268,7 +268,7 @@ struct Texture { max_lod = 0; } break; case RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC: { - use_anisotropy = true; + anisotropy = config->anisotropic_level; }; [[fallthrough]]; case RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS: { @@ -283,7 +283,7 @@ struct Texture { } } break; case RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC: { - use_anisotropy = true; + anisotropy = config->anisotropic_level; }; [[fallthrough]]; case RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS: { @@ -304,8 +304,8 @@ struct Texture { glTexParameteri(target, GL_TEXTURE_MAG_FILTER, pmag); glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, 0); glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, max_lod); - if (config->support_anisotropic_filter && use_anisotropy) { - glTexParameterf(target, _GL_TEXTURE_MAX_ANISOTROPY_EXT, config->anisotropic_level); + if (config->support_anisotropic_filter) { + glTexParameterf(target, _GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy); } } void gl_set_repeat(RS::CanvasItemTextureRepeat p_repeat) { |
