From 2ce0cda333c945de63ad32179026b42fc9307dc8 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 1 Oct 2022 20:39:22 -0700 Subject: [PATCH] Vulkan: Enable geo shader for culling. The compat setting was really for some previously buggy cases that couldn't work without cull. --- GPU/Vulkan/GPU_Vulkan.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 67ed9ae299..6376fc0620 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -232,19 +232,15 @@ u32 GPU_Vulkan::CheckGPUFeatures() const { features |= GPU_SUPPORTS_DEPTH_CLAMP; } - // Force geo shader culling for debugging. -#if 1 - features |= GPU_SUPPORTS_GS_CULLING; - features &= ~GPU_SUPPORTS_VS_RANGE_CULLING; -#else - if (!draw_->GetBugs().Has(Draw::Bugs::BROKEN_NAN_IN_CONDITIONAL)) { - const bool disabled = PSP_CoreParameter().compat.flags().DisableRangeCulling; - // Fall back to geometry shader culling. - if (enabledFeatures.geometryShader && !disabled && (features & GPU_SUPPORTS_VS_RANGE_CULLING) == 0) { + // Fall back to geometry shader culling if we can't do vertex range culling. + if (enabledFeatures.geometryShader) { + const bool vertexSupported = draw_->GetDeviceCaps().clipDistanceSupported && draw_->GetDeviceCaps().cullDistanceSupported; + if (!vertexSupported || (features & GPU_SUPPORTS_VS_RANGE_CULLING) == 0) { + // Switch to culling via the geometry shader if not fully supported in vertex. features |= GPU_SUPPORTS_GS_CULLING; + features &= ~GPU_SUPPORTS_VS_RANGE_CULLING; } } -#endif // These are VULKAN_4444_FORMAT and friends. uint32_t fmt4444 = draw_->GetDataFormatSupport(Draw::DataFormat::B4G4R4A4_UNORM_PACK16);