Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use inaccurate depth with Vulkan on any GPU #17232

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions GPU/Vulkan/GPU_Vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down