aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Vulkan/PipelineFull.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2023-01-19 00:30:42 +0000
committerGitHub <noreply@github.com>2023-01-19 00:30:42 +0000
commitde3134adbec9e35eba08dbb835c38bc305d2c150 (patch)
treec13bbb11f7e9fbbc8dbf303f8f15f40352e0f39d /Ryujinx.Graphics.Vulkan/PipelineFull.cs
parent36d53819a473d195f9efd1253b2421e8670f6c84 (diff)
Vulkan: Explicitly enable precise occlusion queries (#4292)1.1.574
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.
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/PipelineFull.cs')
-rw-r--r--Ryujinx.Graphics.Vulkan/PipelineFull.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Vulkan/PipelineFull.cs b/Ryujinx.Graphics.Vulkan/PipelineFull.cs
index e4bf4fff..5b4f4a6e 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);
}