GS: Fix codacy warnings

This commit is contained in:
refractionpcsx2 2022-08-26 22:56:08 +01:00
parent a71bac037c
commit 4d4825de75
3 changed files with 3 additions and 3 deletions

View File

@ -230,7 +230,7 @@ void GSDevice11::SetupPS(const PSSelector& sel, const GSHWDrawConfig::PSConstant
D3D11_SAMPLER_DESC sd = {};
const int anisotropy = GSConfig.MaxAnisotropy;
if (anisotropy && ssel.aniso)
if (anisotropy > 1 && ssel.aniso)
{
sd.Filter = D3D11_FILTER_ANISOTROPIC;
}

View File

@ -877,7 +877,7 @@ bool GSDevice12::GetSampler(D3D12::DescriptorHandle* cpu_handle, GSHWDrawConfig:
D3D12_SAMPLER_DESC sd = {};
const int anisotropy = GSConfig.MaxAnisotropy;
if (GSConfig.MaxAnisotropy > 1 && ss.aniso)
if (anisotropy > 1 && ss.aniso)
{
sd.Filter = D3D12_FILTER_ANISOTROPIC;
}

View File

@ -888,7 +888,7 @@ GLuint GSDeviceOGL::CreateSampler(PSSamplerSelector sel)
glSamplerParameteri(sampler, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
const int anisotropy = GSConfig.MaxAnisotropy;
if (anisotropy && sel.aniso)
if (anisotropy > 1 && sel.aniso)
{
if (GLExtension::Has("GL_ARB_texture_filter_anisotropic"))
glSamplerParameterf(sampler, GL_TEXTURE_MAX_ANISOTROPY, (float)anisotropy);