You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fixes#79567. This is simply the part of the code change from #79367 that relates to anisotropic filtering. The existing implementation of Texture::gl_set_filter() only calls glTexParameterf with _GL_TEXTURE_MAX_ANISOTROPY_EXT when anisotropic filter is enabled. This has the problem that it won't ever disable anisotropic filtering when switching to a filtering mode that doesn't use it. This PR simply makes it so that it calls it with a value of 1.0f when disabling anisotropic filtering.
This PR targets the master branch, but it should be safe to cherry-pick for a 4.1.X release.
I just noticed something. This is more stylistic than functional, so it isn't a major issue, but I still wanted to bring it up. Should I change float anisotropy to GLfloat anisotropy? Using GLfloat would match the other variables in the function, but both would work basically the same in this context (even for platforms where they aren't the same type, which I don't think Godot even supports). Notably, config->anisotropic_level is a float, not GLfloat, so either way there would be an implicit conversion from float to GLfloat.
I just noticed something. This is more stylistic than functional, so it isn't a major issue, but I still wanted to bring it up. Should I change float anisotropy to GLfloat anisotropy? Using GLfloat would match the other variables in the function, but both would work basically the same in this context (even for platforms where they aren't the same type, which I don't think Godot even supports). Notably, config->anisotropic_level is a float, not GLfloat, so either way there would be an implicit conversion from float to GLfloat.
That's fine GLfloat is just a typdef for float.
YuriSizov
changed the title
GLES3: reset anisotropic filtering when changing texture filtering mode
GLES3: Reset anisotropic filtering when changing texture filtering mode
Jul 21, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #79567. This is simply the part of the code change from #79367 that relates to anisotropic filtering. The existing implementation of
Texture::gl_set_filter()only callsglTexParameterfwith_GL_TEXTURE_MAX_ANISOTROPY_EXTwhen anisotropic filter is enabled. This has the problem that it won't ever disable anisotropic filtering when switching to a filtering mode that doesn't use it. This PR simply makes it so that it calls it with a value of1.0fwhen disabling anisotropic filtering.This PR targets the master branch, but it should be safe to cherry-pick for a 4.1.X release.