Skip to content

Commit

Permalink
Force AccurateDepth on, on older Mali drivers which don't handle reve…
Browse files Browse the repository at this point in the history
…rse Z viewports. Should help hrydgard#10361
  • Loading branch information
hrydgard authored and orbea committed Dec 10, 2017
1 parent e51a563 commit 7ec8063
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions GPU/Vulkan/GPU_Vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ec8063

Please sign in to comment.