Permalink
Browse files

Force AccurateDepth on, on older Mali drivers which don't handle reve…

…rse Z viewports. Should help #10361
  • Loading branch information...
hrydgard committed Dec 10, 2017
1 parent bb530ea commit 2b1f8d36f118b66979c2ca46c2a9c063c4c37bee
Showing with 15 additions and 2 deletions.
  1. +15 −2 GPU/Vulkan/GPU_Vulkan.cpp
View
@@ -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

0 comments on commit 2b1f8d3

Please sign in to comment.