From 2b1f8d36f118b66979c2ca46c2a9c063c4c37bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 10 Dec 2017 19:20:11 +0100 Subject: [PATCH] Force AccurateDepth on, on older Mali drivers which don't handle reverse Z viewports. Should help #10361 --- GPU/Vulkan/GPU_Vulkan.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 1140471a4d..781a51ff36 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -176,9 +176,22 @@ GPU_Vulkan::~GPU_Vulkan() { void GPU_Vulkan::CheckGPUFeatures() { uint32_t features = 0; - // Accurate depth is required on AMD so we ignore the compat flag to disable it on those. See #9545 - if (!PSP_CoreParameter().compat.flags().DisableAccurateDepth || vulkan_->GetPhysicalDeviceProperties().vendorID == VULKAN_VENDOR_AMD) { + switch (vulkan_->GetPhysicalDeviceProperties().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 features |= GPU_SUPPORTS_ACCURATE_DEPTH; + break; + case VULKAN_VENDOR_ARM: + // Also required on older ARM Mali drivers, like the one on many Galaxy S7. + if (!PSP_CoreParameter().compat.flags().DisableAccurateDepth || + vulkan_->GetPhysicalDeviceProperties().driverVersion <= VK_MAKE_VERSION(212, 387, 1927)) { + features |= GPU_SUPPORTS_ACCURATE_DEPTH; + } + break; + default: + if (!PSP_CoreParameter().compat.flags().DisableAccurateDepth) + features |= GPU_SUPPORTS_ACCURATE_DEPTH; + break; } // Mandatory features on Vulkan, which may be checked in "centralized" code