summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorGravatar Wollnashorn2023-06-15 23:16:26 +0200
committerGravatar Wollnashorn2023-06-15 23:16:26 +0200
commita3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b (patch)
tree0b3bea548cb1282d45a53365faea13e4321a69f8 /src/video_core/renderer_vulkan
parentvideo_core: Disable AF for non-color image formats (diff)
downloadyuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.tar.gz
yuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.tar.xz
yuzu-a3b7b5b22af8ef83fc765afac9d6f6b8dac7f62b.zip
video_core: Fallback to default anisotropy instead to 1x anisotropy
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/pipeline_helper.h2
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp6
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h8
3 files changed, 9 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h
index 1632a6f26..0a9dce937 100644
--- a/src/video_core/renderer_vulkan/pipeline_helper.h
+++ b/src/video_core/renderer_vulkan/pipeline_helper.h
@@ -192,7 +192,7 @@ inline void PushImageDescriptors(TextureCache& texture_cache,
192 const Sampler& sampler{**(samplers++)}; 192 const Sampler& sampler{**(samplers++)};
193 const bool use_fallback_sampler{sampler.HasAddedAnisotropy() && 193 const bool use_fallback_sampler{sampler.HasAddedAnisotropy() &&
194 !image_view.SupportsAnisotropy()}; 194 !image_view.SupportsAnisotropy()};
195 const VkSampler vk_sampler{use_fallback_sampler ? sampler.HandleWithoutAnisotropy() 195 const VkSampler vk_sampler{use_fallback_sampler ? sampler.HandleWithDefaultAnisotropy()
196 : sampler.Handle()}; 196 : sampler.Handle()};
197 guest_descriptor_queue.AddSampledImage(vk_image_view, vk_sampler); 197 guest_descriptor_queue.AddSampledImage(vk_image_view, vk_sampler);
198 rescaling.PushTexture(texture_cache.IsRescaling(image_view)); 198 rescaling.PushTexture(texture_cache.IsRescaling(image_view));
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 8ec181335..f025f618b 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -1827,8 +1827,10 @@ Sampler::Sampler(TextureCacheRuntime& runtime, const Tegra::Texture::TSCEntry& t
1827 }; 1827 };
1828 1828
1829 sampler = create_sampler(max_anisotropy); 1829 sampler = create_sampler(max_anisotropy);
1830 if (Settings::values.max_anisotropy.GetValue() > 0 && max_anisotropy > 1.0f) { 1830
1831 sampler_without_anisotropy = create_sampler(1.0f); 1831 const f32 max_anisotropy_default = static_cast<f32>(1U << tsc.max_anisotropy);
1832 if (max_anisotropy > max_anisotropy_default) {
1833 sampler_default_anisotropy = create_sampler(max_anisotropy_default);
1832 } 1834 }
1833} 1835}
1834 1836
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h
index ee0d0480d..f14525dcb 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.h
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.h
@@ -279,17 +279,17 @@ public:
279 return *sampler; 279 return *sampler;
280 } 280 }
281 281
282 [[nodiscard]] VkSampler HandleWithoutAnisotropy() const noexcept { 282 [[nodiscard]] VkSampler HandleWithDefaultAnisotropy() const noexcept {
283 return *sampler_without_anisotropy; 283 return *sampler_default_anisotropy;
284 } 284 }
285 285
286 [[nodiscard]] bool HasAddedAnisotropy() const noexcept { 286 [[nodiscard]] bool HasAddedAnisotropy() const noexcept {
287 return static_cast<bool>(sampler_without_anisotropy); 287 return static_cast<bool>(sampler_default_anisotropy);
288 } 288 }
289 289
290private: 290private:
291 vk::Sampler sampler; 291 vk::Sampler sampler;
292 vk::Sampler sampler_without_anisotropy; 292 vk::Sampler sampler_default_anisotropy;
293}; 293};
294 294
295class Framebuffer { 295class Framebuffer {