Implement support for masked stencil clears on Vulkan (#5589)

* Implement support for masked stencil clears on Vulkan

* PR feedback
This commit is contained in:
gdkchan
2023-08-18 02:25:54 -03:00
committed by GitHub
parent c6a699414a
commit 153b8bfc7c
7 changed files with 131 additions and 38 deletions

View File

@ -243,10 +243,8 @@ namespace Ryujinx.Graphics.Vulkan
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
}
public unsafe void ClearRenderTargetDepthStencil(int layer, int layerCount, float depthValue, bool depthMask, int stencilValue, int stencilMask)
public unsafe void ClearRenderTargetDepthStencil(int layer, int layerCount, float depthValue, bool depthMask, int stencilValue, bool stencilMask)
{
// TODO: Use stencilMask (fully).
if (FramebufferParams == null || !FramebufferParams.HasDepthStencil)
{
return;
@ -255,7 +253,7 @@ namespace Ryujinx.Graphics.Vulkan
var clearValue = new ClearValue(null, new ClearDepthStencilValue(depthValue, (uint)stencilValue));
var flags = depthMask ? ImageAspectFlags.DepthBit : 0;
if (stencilMask != 0)
if (stencilMask)
{
flags |= ImageAspectFlags.StencilBit;
}