From 5e61febab1c83bb55bda86bb8b28298695094d99 Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:31:11 +0300 Subject: [PATCH] Force enable anisotropic filtering. --- UnleashedRecomp/gpu/video.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/UnleashedRecomp/gpu/video.cpp b/UnleashedRecomp/gpu/video.cpp index 75a1111..3473494 100644 --- a/UnleashedRecomp/gpu/video.cpp +++ b/UnleashedRecomp/gpu/video.cpp @@ -1357,11 +1357,18 @@ static void FlushRenderState(GuestDevice* device) const auto addressU = ConvertTextureAddressMode((device->samplerStates[i].data[0].get() >> 10) & 0x7); const auto addressV = ConvertTextureAddressMode((device->samplerStates[i].data[0].get() >> 13) & 0x7); const auto addressW = ConvertTextureAddressMode((device->samplerStates[i].data[0].get() >> 16) & 0x7); - const auto magFilter = ConvertTextureFilter((device->samplerStates[i].data[3].get() >> 19) & 0x3); - const auto minFilter = ConvertTextureFilter((device->samplerStates[i].data[3].get() >> 21) & 0x3); - const auto mipFilter = ConvertTextureFilter((device->samplerStates[i].data[3].get() >> 23) & 0x3); + auto magFilter = ConvertTextureFilter((device->samplerStates[i].data[3].get() >> 19) & 0x3); + auto minFilter = ConvertTextureFilter((device->samplerStates[i].data[3].get() >> 21) & 0x3); + auto mipFilter = ConvertTextureFilter((device->samplerStates[i].data[3].get() >> 23) & 0x3); const auto borderColor = ConvertBorderColor(device->samplerStates[i].data[5].get() & 0x3); + bool anisotropyEnabled = mipFilter == RenderFilter::LINEAR; + if (anisotropyEnabled) + { + magFilter = RenderFilter::LINEAR; + minFilter = RenderFilter::LINEAR; + } + auto& samplerDesc = g_samplerDescs[i]; bool dirty = false; @@ -1372,6 +1379,7 @@ static void FlushRenderState(GuestDevice* device) SetDirtyValue(dirty, samplerDesc.minFilter, minFilter); SetDirtyValue(dirty, samplerDesc.magFilter, magFilter); SetDirtyValue(dirty, samplerDesc.mipmapMode, RenderMipmapMode(mipFilter)); + SetDirtyValue(dirty, samplerDesc.anisotropyEnabled, anisotropyEnabled); SetDirtyValue(dirty, samplerDesc.borderColor, borderColor); if (dirty)