TextureCache: Add automatic anisotropic filtering and refactor code.
This commit is contained in:
parent
5230378709
commit
282e04bffb
5 changed files with 22 additions and 16 deletions
|
@ -1448,13 +1448,7 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
|
|||
LOG_WARNING(Render_Vulkan, "VK_EXT_sampler_filter_minmax is required");
|
||||
}
|
||||
// Some games have samplers with garbage. Sanitize them here.
|
||||
const f32 setting_anisotropic =
|
||||
static_cast<f32>(1U << Settings::values.max_anisotropy.GetValue());
|
||||
const f32 game_anisotropic = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
|
||||
const bool aument_anisotropic =
|
||||
game_anisotropic > 1.0f || tsc.mipmap_filter == TextureMipmapFilter::Linear;
|
||||
const f32 max_anisotropy =
|
||||
aument_anisotropic ? std::max(game_anisotropic, setting_anisotropic) : game_anisotropic;
|
||||
const f32 max_anisotropy = std::clamp(tsc.MaxAnisotropy(), 1.0f, 16.0f);
|
||||
|
||||
sampler = device.GetLogical().CreateSampler(VkSamplerCreateInfo{
|
||||
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue