diff --git a/Ryujinx.Graphics.Vulkan/HardwareCapabilities.cs b/Ryujinx.Graphics.Vulkan/HardwareCapabilities.cs index 0a4d365f25..8685d34421 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; diff --git a/Ryujinx.Graphics.Vulkan/PipelineFull.cs b/Ryujinx.Graphics.Vulkan/PipelineFull.cs index e4bf4fffac..5b4f4a6e9f 100644 --- a/Ryujinx.Graphics.Vulkan/PipelineFull.cs +++ b/Ryujinx.Graphics.Vulkan/PipelineFull.cs @@ -235,7 +235,7 @@ namespace Ryujinx.Graphics.Vulkan foreach (var queryPool in _activeQueries) { Gd.Api.CmdResetQueryPool(CommandBuffer, queryPool, 0, 1); - Gd.Api.CmdBeginQuery(CommandBuffer, queryPool, 0, 0); + Gd.Api.CmdBeginQuery(CommandBuffer, queryPool, 0, Gd.Capabilities.SupportsPreciseOcclusionQueries ? QueryControlFlags.PreciseBit : 0); } Restore(); @@ -255,7 +255,7 @@ namespace Ryujinx.Graphics.Vulkan } } - Gd.Api.CmdBeginQuery(CommandBuffer, pool, 0, 0); + Gd.Api.CmdBeginQuery(CommandBuffer, pool, 0, Gd.Capabilities.SupportsPreciseOcclusionQueries ? QueryControlFlags.PreciseBit : 0); _activeQueries.Add(pool); } diff --git a/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs b/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs index fe9462aa3e..00baad1036 100644 --- a/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs +++ b/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs @@ -416,6 +416,7 @@ namespace Ryujinx.Graphics.Vulkan IndependentBlend = true, LogicOp = supportedFeatures.LogicOp, MultiViewport = true, + OcclusionQueryPrecise = supportedFeatures.OcclusionQueryPrecise, PipelineStatisticsQuery = supportedFeatures.PipelineStatisticsQuery, SamplerAnisotropy = true, ShaderClipDistance = true, diff --git a/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs b/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs index f1922efed0..bec7b84755 100644 --- a/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs +++ b/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs @@ -270,6 +270,7 @@ namespace Ryujinx.Graphics.Vulkan supportedExtensions.Contains(KhrPushDescriptor.ExtensionName), supportsTransformFeedback, propertiesTransformFeedback.TransformFeedbackQueries, + features2.Features.OcclusionQueryPrecise, supportedFeatures.GeometryShader, propertiesSubgroupSizeControl.MinSubgroupSize, propertiesSubgroupSizeControl.MaxSubgroupSize,