From de3134adbec9e35eba08dbb835c38bc305d2c150 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Thu, 19 Jan 2023 00:30:42 +0000 Subject: Vulkan: Explicitly enable precise occlusion queries (#4292) The only guarantee of the occlusion query type in Vulkan is that it will be zero when no samples pass, and non-zero when any samples pass. Of course, most GPUs implement this by just placing the # of samples in the result and calling it a day. However, this lax restriction means that GPUs could just report a boolean (1/0) or report a value after one is recorded, but before all samples have been counted. MoltenVK falls in the first category - by default it only reports 1/0 for occlusion queries. Thankfully, there is a feature and flag that you can use to force compatible drivers to provide a "precise" query result, that being the real # of samples passed. Should fix ink collision in Splatoon 2/3 on MoltenVK. --- Ryujinx.Graphics.Vulkan/HardwareCapabilities.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Ryujinx.Graphics.Vulkan/HardwareCapabilities.cs') diff --git a/Ryujinx.Graphics.Vulkan/HardwareCapabilities.cs b/Ryujinx.Graphics.Vulkan/HardwareCapabilities.cs index 0a4d365f..8685d344 100644 --- a/Ryujinx.Graphics.Vulkan/HardwareCapabilities.cs +++ b/Ryujinx.Graphics.Vulkan/HardwareCapabilities.cs @@ -28,6 +28,7 @@ namespace Ryujinx.Graphics.Vulkan public readonly bool SupportsExtendedDynamicState; public readonly bool SupportsMultiView; public readonly bool SupportsNullDescriptors; + public readonly bool SupportsPreciseOcclusionQueries; public readonly bool SupportsPushDescriptors; public readonly bool SupportsTransformFeedback; public readonly bool SupportsTransformFeedbackQueries; @@ -53,6 +54,7 @@ namespace Ryujinx.Graphics.Vulkan bool supportsPushDescriptors, bool supportsTransformFeedback, bool supportsTransformFeedbackQueries, + bool supportsPreciseOcclusionQueries, bool supportsGeometryShader, uint minSubgroupSize, uint maxSubgroupSize, @@ -74,6 +76,7 @@ namespace Ryujinx.Graphics.Vulkan SupportsPushDescriptors = supportsPushDescriptors; SupportsTransformFeedback = supportsTransformFeedback; SupportsTransformFeedbackQueries = supportsTransformFeedbackQueries; + SupportsPreciseOcclusionQueries = supportsPreciseOcclusionQueries; SupportsGeometryShader = supportsGeometryShader; MinSubgroupSize = minSubgroupSize; MaxSubgroupSize = maxSubgroupSize; -- cgit v1.2.3