diff options
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/PipelineBase.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index b76e482b..b0bc1d0d 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -245,20 +245,13 @@ namespace Ryujinx.Graphics.Vulkan public unsafe void ClearRenderTargetDepthStencil(int layer, int layerCount, float depthValue, bool depthMask, int stencilValue, int stencilMask) { - // TODO: Use stencilMask (fully) + // TODO: Use stencilMask (fully). if (FramebufferParams == null || !FramebufferParams.HasDepthStencil) { return; } - if (_renderPass == null) - { - CreateRenderPass(); - } - - BeginRenderPass(); - var clearValue = new ClearValue(null, new ClearDepthStencilValue(depthValue, (uint)stencilValue)); var flags = depthMask ? ImageAspectFlags.DepthBit : 0; @@ -267,6 +260,20 @@ namespace Ryujinx.Graphics.Vulkan flags |= ImageAspectFlags.StencilBit; } + flags &= FramebufferParams.GetDepthStencilAspectFlags(); + + if (flags == ImageAspectFlags.None) + { + return; + } + + if (_renderPass == null) + { + CreateRenderPass(); + } + + BeginRenderPass(); + var attachment = new ClearAttachment(flags, 0, clearValue); var clearRect = FramebufferParams.GetClearRect(ClearScissor, layer, layerCount); @@ -935,7 +942,7 @@ namespace Ryujinx.Graphics.Vulkan SignalStateChange(); - if (_program.IsCompute) + if (internalProgram.IsCompute) { EndRenderPass(); } |