From 3a69569580fc76c4ce42120de49150a5378ae573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 3 Apr 2023 22:36:13 +0200 Subject: [PATCH] Don't use inaccurate depth with Vulkan on any GPU except some special-cased Mali drivers. Fixes #17044 --- GPU/Vulkan/GPU_Vulkan.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 91a8ce6f8480..59f29dff8d21 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -196,6 +196,8 @@ u32 GPU_Vulkan::CheckGPUFeatures() const { uint32_t features = GPUCommonHW::CheckGPUFeatures(); VulkanContext *vulkan = (VulkanContext *)draw_->GetNativeObject(Draw::NativeObject::CONTEXT); + + // Could simplify this, but it's good as documentation. switch (vulkan->GetPhysicalDeviceProperties().properties.vendorID) { case VULKAN_VENDOR_AMD: // Accurate depth is required on AMD (due to reverse-Z driver bug) so we ignore the compat flag to disable it on those. See #9545 @@ -221,12 +223,13 @@ u32 GPU_Vulkan::CheckGPUFeatures() const { } break; } + case VULKAN_VENDOR_IMGTEC: + // We ignore the disable flag on IMGTec. Another reverse-Z bug (plus, not really any reason to bother). See #17044 + features |= GPU_USE_ACCURATE_DEPTH; + break; default: - if (!PSP_CoreParameter().compat.flags().DisableAccurateDepth) { - features |= GPU_USE_ACCURATE_DEPTH; - } else { - features &= ~GPU_USE_ACCURATE_DEPTH; - } + // On other GPUs we'll just assume we don't need inaccurate depth, leaving ARM Mali as the odd one out. + features |= GPU_USE_ACCURATE_DEPTH; break; }