From 54aae3e6d456ee469854608a4e13b8924573d201 Mon Sep 17 00:00:00 2001 From: vladislavbelov Date: Mon, 6 Jun 2022 06:59:20 +0000 Subject: [PATCH] Moves anisotropic filtering support check from GL texture to TextureManager to make it explicit. This was SVN commit r26919. --- source/graphics/TextureManager.cpp | 2 +- source/renderer/backend/gl/Texture.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/graphics/TextureManager.cpp b/source/graphics/TextureManager.cpp index 0d5640b770..11a46c0cb2 100644 --- a/source/graphics/TextureManager.cpp +++ b/source/graphics/TextureManager.cpp @@ -525,7 +525,7 @@ public: defaultSamplerDesc.addressModeU = texture->m_Properties.m_AddressModeU; defaultSamplerDesc.addressModeV = texture->m_Properties.m_AddressModeV; - if (texture->m_Properties.m_AnisotropicFilterEnabled) + if (texture->m_Properties.m_AnisotropicFilterEnabled && m_Device->GetCapabilities().anisotropicFiltering) { int maxAnisotropy = 1; CFG_GET_VAL("textures.maxanisotropy", maxAnisotropy); diff --git a/source/renderer/backend/gl/Texture.cpp b/source/renderer/backend/gl/Texture.cpp index c71a39c6ca..0a9eb8c33f 100644 --- a/source/renderer/backend/gl/Texture.cpp +++ b/source/renderer/backend/gl/Texture.cpp @@ -140,9 +140,9 @@ std::unique_ptr CTexture::Create(CDevice* device, const char* name, glTexParameteri(target, GL_TEXTURE_LOD_BIAS, defaultSamplerDesc.mipLODBias); #endif // !CONFIG2_GLES - if (type == Type::TEXTURE_2D && defaultSamplerDesc.anisotropyEnabled && - texture->m_Device->GetCapabilities().anisotropicFiltering) + if (type == Type::TEXTURE_2D && defaultSamplerDesc.anisotropyEnabled) { + ENSURE(texture->m_Device->GetCapabilities().anisotropicFiltering); const float maxAnisotropy = std::min( defaultSamplerDesc.maxAnisotropy, texture->m_Device->GetCapabilities().maxAnisotropy); glTexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy);