diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2016-03-26 03:25:01 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2016-03-26 03:25:01 +0100 |
| commit | 2fd08843475aaa023a7a1b8c56c7bf141b042e6c (patch) | |
| tree | 3a6a1c0d383d1bffcf9ac37df0361afa4da19006 /Source/Core/VideoBackends/D3D/D3DState.cpp | |
| parent | ae4cb12033eb01df67cea1f054d44526fe093059 (diff) | |
| parent | 0b9a72a62d38481ff08f742b2318d07f29ff5dff (diff) | |
Merge pull request #3672 from EmptyChaos/d3d-anisotropy
Fix D3D Forced Anisotropy
Diffstat (limited to 'Source/Core/VideoBackends/D3D/D3DState.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/D3DState.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/D3D/D3DState.cpp b/Source/Core/VideoBackends/D3D/D3DState.cpp index c5c70dd19a..64c6b48740 100644 --- a/Source/Core/VideoBackends/D3D/D3DState.cpp +++ b/Source/Core/VideoBackends/D3D/D3DState.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include <algorithm> + #include "Common/BitSet.h" #include "Common/CommonTypes.h" #include "Common/MsgHandler.h" @@ -9,6 +11,7 @@ #include "VideoBackends/D3D/D3DBase.h" #include "VideoBackends/D3D/D3DState.h" +#include "VideoCommon/SamplerCommon.h" namespace DX11 { @@ -259,7 +262,7 @@ ID3D11SamplerState* StateCache::Get(SamplerState state) unsigned int mip = d3dMipFilters[state.min_filter & 3]; - if (state.max_anisotropy > 1) + if (state.max_anisotropy > 1 && !SamplerCommon::IsBpTexMode0PointFiltering(state)) { sampdc.Filter = D3D11_FILTER_ANISOTROPIC; sampdc.MaxAnisotropy = (u32)state.max_anisotropy; @@ -310,8 +313,8 @@ ID3D11SamplerState* StateCache::Get(SamplerState state) sampdc.AddressU = d3dClamps[state.wrap_s]; sampdc.AddressV = d3dClamps[state.wrap_t]; - sampdc.MaxLOD = (mip == TexMode0::TEXF_NONE) ? 0.0f : (float)state.max_lod / 16.f; - sampdc.MinLOD = (float)state.min_lod / 16.f; + sampdc.MaxLOD = SamplerCommon::AreBpTexMode0MipmapsEnabled(state) ? state.max_lod / 16.f : 0.f; + sampdc.MinLOD = std::min(state.min_lod / 16.f, sampdc.MaxLOD); sampdc.MipLODBias = (s32)state.lod_bias / 32.0f; ID3D11SamplerState* res = nullptr; |
