GS-d3d11: MaxAnisotropy value range is 1-16, clamp it.

This commit is contained in:
lightningterror 2021-12-29 15:01:36 +01:00
parent 0375f9c0ae
commit 66cfb403c6
2 changed files with 3 additions and 3 deletions

View File

@ -374,7 +374,7 @@ bool GSDevice11::Create(const WindowInfo& wi)
sd.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; sd.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
sd.MinLOD = -FLT_MAX; sd.MinLOD = -FLT_MAX;
sd.MaxLOD = FLT_MAX; sd.MaxLOD = FLT_MAX;
sd.MaxAnisotropy = D3D11_MIN_MAXANISOTROPY; sd.MaxAnisotropy = 1;
sd.ComparisonFunc = D3D11_COMPARISON_NEVER; sd.ComparisonFunc = D3D11_COMPARISON_NEVER;
m_dev->CreateSamplerState(&sd, m_convert.ln.put()); m_dev->CreateSamplerState(&sd, m_convert.ln.put());

View File

@ -56,7 +56,7 @@ bool GSDevice11::CreateTextureFX()
sd.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; sd.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
sd.MinLOD = -FLT_MAX; sd.MinLOD = -FLT_MAX;
sd.MaxLOD = FLT_MAX; sd.MaxLOD = FLT_MAX;
sd.MaxAnisotropy = D3D11_MIN_MAXANISOTROPY; sd.MaxAnisotropy = 1;
sd.ComparisonFunc = D3D11_COMPARISON_NEVER; sd.ComparisonFunc = D3D11_COMPARISON_NEVER;
hr = m_dev->CreateSamplerState(&sd, m_palette_ss.put()); hr = m_dev->CreateSamplerState(&sd, m_palette_ss.put());
@ -237,7 +237,7 @@ void GSDevice11::SetupPS(PSSelector sel, const GSHWDrawConfig::PSConstantBuffer*
sd.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; sd.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
sd.MinLOD = -FLT_MAX; sd.MinLOD = -FLT_MAX;
sd.MaxLOD = FLT_MAX; sd.MaxLOD = FLT_MAX;
sd.MaxAnisotropy = anisotropy; sd.MaxAnisotropy = std::clamp(anisotropy, 1, 16);
sd.ComparisonFunc = D3D11_COMPARISON_NEVER; sd.ComparisonFunc = D3D11_COMPARISON_NEVER;
m_dev->CreateSamplerState(&sd, &ss0); m_dev->CreateSamplerState(&sd, &ss0);