GPU: Allow the user to set an anisotropic filtering setting below the implementation-defined value of `GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT`

Allow the user to set an anisotropic filtering setting below the implementation-defined value of `GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT`.

This bug-fix is also needed for 2.93 LTS.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14392
This commit is contained in:
Ethan-Hall 2022-03-21 13:46:12 +01:00 committed by Clément Foucault
parent c5456819ee
commit be3eef19c0
Notes: blender-bot 2023-02-14 08:08:56 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #96241, 3.1: Potential candidates for corrective releases
1 changed files with 1 additions and 1 deletions

View File

@ -569,7 +569,7 @@ void GLTexture::samplers_update()
float max_anisotropy = 1.0f;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max_anisotropy);
float aniso_filter = max_ff(max_anisotropy, U.anisotropic_filter);
float aniso_filter = min_ff(max_anisotropy, U.anisotropic_filter);
for (int i = 0; i <= GPU_SAMPLER_ICON - 1; i++) {
eGPUSamplerState state = static_cast<eGPUSamplerState>(i);