From d0b225df7cc2b2f0ec7fd1d907d6e0caedff3b0a Mon Sep 17 00:00:00 2001 From: CPkmn Date: Sat, 20 Sep 2014 22:39:01 -0700 Subject: [PATCH] D3D9 Get maxAnisotropyLevel from device caps --- GPU/Directx9/TextureCacheDX9.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index af31a78fc1..edc17e01d4 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -74,8 +74,20 @@ TextureCacheDX9::TextureCacheDX9() : clearCacheNextFrame_(false), lowMemoryMode_ memset(clutBufConverted_, 0, 4096 * sizeof(u32)); memset(clutBufRaw_, 0, 4096 * sizeof(u32)); - // TODO: Get from device caps! - maxAnisotropyLevel = 16; + D3DCAPS9 pCaps; + ZeroMemory(&pCaps, sizeof(pCaps)); + HRESULT result = 0; + if (pD3DdeviceEx) { + result = pD3DdeviceEx->GetDeviceCaps(&pCaps); + } else { + result = pD3Ddevice->GetDeviceCaps(&pCaps); + } + if (FAILED(result)) { + WARN_LOG(G3D, "Failed to get the device caps!"); + maxAnisotropyLevel = 16; + } else { + maxAnisotropyLevel = pCaps.MaxAnisotropy; + } SetupTextureDecoder(); }