diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-05-28 19:24:35 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 00:24:35 +0200 |
commit | 96d1f0da2d10545600d83a88e63cfef9b2785e25 (patch) | |
tree | e29b2cef6bb32578154a484d9276d35f62964d76 | |
parent | 597388ecda35b0feaa3b678b7216689a5d84bbac (diff) |
Workaround for MoltenVK barrier issues (#5118)1.1.839
-rw-r--r-- | src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index c254d378..688682f4 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -80,6 +80,7 @@ namespace Ryujinx.Graphics.Vulkan private PipelineColorBlendAttachmentState[] _storedBlend; + private ulong _drawCountSinceBarrier; public ulong DrawCount { get; private set; } public bool RenderPassActive { get; private set; } @@ -133,6 +134,18 @@ namespace Ryujinx.Graphics.Vulkan public unsafe void Barrier() { + if (_drawCountSinceBarrier != DrawCount) + { + _drawCountSinceBarrier = DrawCount; + + // Barriers apparently have no effect inside a render pass on MoltenVK. + // As a workaround, end the render pass. + if (Gd.IsMoltenVk) + { + EndRenderPass(); + } + } + MemoryBarrier memoryBarrier = new MemoryBarrier() { SType = StructureType.MemoryBarrier, |