Implement HLE macros for render target clears (#3528)

* Implement HLE macros for render target clears

* Add constants for the offsets
This commit is contained in:
gdkchan 2022-08-04 18:30:08 -03:00 committed by GitHub
parent c48a75979f
commit 1080f64df9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 149 additions and 43 deletions

View file

@ -162,7 +162,7 @@ namespace Ryujinx.Graphics.Vulkan
size);
}
public unsafe void ClearRenderTargetColor(int index, int layer, ColorF color)
public unsafe void ClearRenderTargetColor(int index, int layer, int layerCount, ColorF color)
{
if (FramebufferParams == null || !FramebufferParams.IsValidColorAttachment(index))
{
@ -178,12 +178,12 @@ namespace Ryujinx.Graphics.Vulkan
var clearValue = new ClearValue(new ClearColorValue(color.Red, color.Green, color.Blue, color.Alpha));
var attachment = new ClearAttachment(ImageAspectFlags.ImageAspectColorBit, (uint)index, clearValue);
var clearRect = FramebufferParams?.GetClearRect(ClearScissor, layer) ?? default;
var clearRect = FramebufferParams.GetClearRect(ClearScissor, layer, layerCount);
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
}
public unsafe void ClearRenderTargetDepthStencil(int layer, float depthValue, bool depthMask, int stencilValue, int stencilMask)
public unsafe void ClearRenderTargetDepthStencil(int layer, int layerCount, float depthValue, bool depthMask, int stencilValue, int stencilMask)
{
// TODO: Use stencilMask (fully)
@ -208,7 +208,7 @@ namespace Ryujinx.Graphics.Vulkan
}
var attachment = new ClearAttachment(flags, 0, clearValue);
var clearRect = FramebufferParams?.GetClearRect(ClearScissor, layer) ?? default;
var clearRect = FramebufferParams.GetClearRect(ClearScissor, layer, layerCount);
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
}