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:
parent
c48a75979f
commit
1080f64df9
16 changed files with 149 additions and 43 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue