mirror of https://github.com/PCSX2/pcsx2.git
GS/HW: Make trilinear filtering behavior consistent across backends
Previously, triln=0 would result in nearest mipmap filtering in D3D/Vulkan, but forced base level in OpenGL.
This commit is contained in:
parent
f2e6c61bfa
commit
3bbb510b7a
|
@ -259,7 +259,7 @@ void GSDevice11::SetupPS(const PSSelector& sel, const GSHWDrawConfig::PSConstant
|
|||
sd.AddressV = ssel.tav ? D3D11_TEXTURE_ADDRESS_WRAP : D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
sd.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
sd.MinLOD = 0.0f;
|
||||
sd.MaxLOD = ssel.lodclamp ? 0.0f : FLT_MAX;
|
||||
sd.MaxLOD = (ssel.lodclamp || !ssel.UseMipmapFiltering()) ? 0.25f : FLT_MAX;
|
||||
sd.MaxAnisotropy = std::clamp(anisotropy, 1, 16);
|
||||
sd.ComparisonFunc = D3D11_COMPARISON_NEVER;
|
||||
|
||||
|
|
|
@ -908,7 +908,7 @@ bool GSDevice12::GetSampler(D3D12::DescriptorHandle* cpu_handle, GSHWDrawConfig:
|
|||
sd.AddressV = ss.tav ? D3D12_TEXTURE_ADDRESS_MODE_WRAP : D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
|
||||
sd.AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP;
|
||||
sd.MinLOD = 0.0f;
|
||||
sd.MaxLOD = ss.lodclamp ? 0.0f : FLT_MAX;
|
||||
sd.MaxLOD = (ss.lodclamp || !ss.UseMipmapFiltering()) ? 0.25f : FLT_MAX;
|
||||
sd.MaxAnisotropy = std::clamp(GSConfig.MaxAnisotropy, 1, 16);
|
||||
sd.ComparisonFunc = D3D12_COMPARISON_FUNC_NEVER;
|
||||
|
||||
|
|
|
@ -883,7 +883,7 @@ GLuint GSDeviceOGL::CreateSampler(PSSamplerSelector sel)
|
|||
}
|
||||
|
||||
glSamplerParameterf(sampler, GL_TEXTURE_MIN_LOD, -1000.0f);
|
||||
glSamplerParameterf(sampler, GL_TEXTURE_MAX_LOD, sel.lodclamp ? 0.0f : 1000.0f);
|
||||
glSamplerParameterf(sampler, GL_TEXTURE_MAX_LOD, sel.lodclamp ? 0.25f : 1000.0f);
|
||||
|
||||
if (sel.tau)
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
|
|
|
@ -1029,7 +1029,7 @@ VkSampler GSDeviceVK::GetSampler(GSHWDrawConfig::SamplerSelector ss)
|
|||
VK_FALSE, // compare enable
|
||||
VK_COMPARE_OP_ALWAYS, // compare op
|
||||
0.0f, // min lod
|
||||
ss.lodclamp ? 0.25f : VK_LOD_CLAMP_NONE, // max lod
|
||||
(ss.lodclamp || !ss.UseMipmapFiltering()) ? 0.25f : VK_LOD_CLAMP_NONE, // max lod
|
||||
VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK, // border
|
||||
VK_FALSE // unnormalized coordinates
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue