mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Enable anisotropic filtering when the game requests it
This commit is contained in:
@ -344,10 +344,10 @@ ID3D11SamplerState* StateCache::Get(SamplerState state)
|
||||
sampdc.MinLOD = state.tm1.min_lod / 16.f;
|
||||
sampdc.MipLODBias = state.tm0.lod_bias / 256.f;
|
||||
|
||||
if (state.tm0.anisotropic_filtering)
|
||||
if (state.tm0.anisotropic_filtering != 0)
|
||||
{
|
||||
sampdc.Filter = D3D11_FILTER_ANISOTROPIC;
|
||||
sampdc.MaxAnisotropy = 1u << g_ActiveConfig.iMaxAnisotropy;
|
||||
sampdc.MaxAnisotropy = 1u << state.tm0.anisotropic_filtering;
|
||||
}
|
||||
|
||||
ComPtr<ID3D11SamplerState> res;
|
||||
|
@ -128,10 +128,10 @@ static void GetD3DSamplerDesc(D3D12_SAMPLER_DESC* desc, const SamplerState& stat
|
||||
desc->MipLODBias = static_cast<s32>(state.tm0.lod_bias) / 256.f;
|
||||
desc->ComparisonFunc = D3D12_COMPARISON_FUNC_NEVER;
|
||||
|
||||
if (state.tm0.anisotropic_filtering)
|
||||
if (state.tm0.anisotropic_filtering != 0)
|
||||
{
|
||||
desc->Filter = D3D12_FILTER_ANISOTROPIC;
|
||||
desc->MaxAnisotropy = 1u << g_ActiveConfig.iMaxAnisotropy;
|
||||
desc->MaxAnisotropy = 1u << state.tm0.anisotropic_filtering;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,10 +102,10 @@ void SamplerCache::SetParameters(GLuint sampler_id, const SamplerState& params)
|
||||
glSamplerParameterf(sampler_id, GL_TEXTURE_LOD_BIAS, params.tm0.lod_bias / 256.f);
|
||||
}
|
||||
|
||||
if (params.tm0.anisotropic_filtering && g_ogl_config.bSupportsAniso)
|
||||
if (params.tm0.anisotropic_filtering != 0 && g_ogl_config.bSupportsAniso)
|
||||
{
|
||||
glSamplerParameterf(sampler_id, GL_TEXTURE_MAX_ANISOTROPY_EXT,
|
||||
static_cast<float>(1 << g_ActiveConfig.iMaxAnisotropy));
|
||||
static_cast<float>(1 << params.tm0.anisotropic_filtering));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -398,11 +398,11 @@ VkSampler ObjectCache::GetSampler(const SamplerState& info)
|
||||
};
|
||||
|
||||
// Can we use anisotropic filtering with this sampler?
|
||||
if (info.tm0.anisotropic_filtering && g_vulkan_context->SupportsAnisotropicFiltering())
|
||||
if (info.tm0.anisotropic_filtering != 0 && g_vulkan_context->SupportsAnisotropicFiltering())
|
||||
{
|
||||
// Cap anisotropy to device limits.
|
||||
create_info.anisotropyEnable = VK_TRUE;
|
||||
create_info.maxAnisotropy = std::min(static_cast<float>(1 << g_ActiveConfig.iMaxAnisotropy),
|
||||
create_info.maxAnisotropy = std::min(static_cast<float>(1 << info.tm0.anisotropic_filtering),
|
||||
g_vulkan_context->GetMaxSamplerAnisotropy());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user