texture_cache: Don't read max ansio value if not aniso filter (#1942)

Fix Sonic Forces.
This commit is contained in:
Quang Ngô 2024-12-28 18:18:56 +07:00 committed by GitHub
parent f0352d2f7d
commit 99e1e028c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -447,7 +447,7 @@ struct Sampler {
}
float MaxAniso() const {
switch (max_aniso) {
switch (max_aniso.Value()) {
case AnisoRatio::One:
return 1.0f;
case AnisoRatio::Two:

View file

@ -18,7 +18,8 @@ Sampler::Sampler(const Vulkan::Instance& instance, const AmdGpu::Sampler& sample
(AmdGpu::IsAnisoFilter(sampler.xy_mag_filter) ||
AmdGpu::IsAnisoFilter(sampler.xy_min_filter));
const float maxAnisotropy =
std::clamp(sampler.MaxAniso(), 1.0f, instance.MaxSamplerAnisotropy());
anisotropyEnable ? std::clamp(sampler.MaxAniso(), 1.0f, instance.MaxSamplerAnisotropy())
: 1.0f;
const vk::SamplerCreateInfo sampler_ci = {
.magFilter = LiverpoolToVK::Filter(sampler.xy_mag_filter),
.minFilter = LiverpoolToVK::Filter(sampler.xy_min_filter),