mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-21 00:23:36 +00:00
Add missing clear layer parameter after rebase
This commit is contained in:
parent
0e06449f90
commit
0860e208b2
4 changed files with 10 additions and 9 deletions
|
@ -149,14 +149,14 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
return texture is TextureView view && view.Valid;
|
||||
}
|
||||
|
||||
public ClearRect GetClearRect(Rectangle<int> scissor)
|
||||
public ClearRect GetClearRect(Rectangle<int> scissor, int layer)
|
||||
{
|
||||
int x = scissor.X;
|
||||
int y = scissor.Y;
|
||||
int width = Math.Min((int)Width - scissor.X, scissor.Width);
|
||||
int height = Math.Min((int)Height - scissor.Y, scissor.Height);
|
||||
|
||||
return new ClearRect(new Rect2D(new Offset2D(x, y), new Extent2D((uint)width, (uint)height)), 0, Layers);
|
||||
return new ClearRect(new Rect2D(new Offset2D(x, y), new Extent2D((uint)width, (uint)height)), (uint)layer, 1);
|
||||
}
|
||||
|
||||
public unsafe Auto<DisposableFramebuffer> Create(Vk api, CommandBufferScoped cbs, Auto<DisposableRenderPass> renderPass)
|
||||
|
|
|
@ -178,7 +178,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
if (clearAlpha)
|
||||
{
|
||||
_pipeline.ClearRenderTargetColor(0, new ColorF(0f, 0f, 0f, 1f));
|
||||
_pipeline.ClearRenderTargetColor(0, 0, new ColorF(0f, 0f, 0f, 1f));
|
||||
}
|
||||
|
||||
_pipeline.SetViewports(0, viewports, false);
|
||||
|
|
|
@ -159,7 +159,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
size);
|
||||
}
|
||||
|
||||
public unsafe void ClearRenderTargetColor(int index, ColorF color)
|
||||
public unsafe void ClearRenderTargetColor(int index, int layer, ColorF color)
|
||||
{
|
||||
if (FramebufferParams == null || !FramebufferParams.IsVaidColorAttachment(index))
|
||||
{
|
||||
|
@ -175,12 +175,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) ?? default;
|
||||
var clearRect = FramebufferParams?.GetClearRect(ClearScissor, layer) ?? default;
|
||||
|
||||
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
|
||||
}
|
||||
|
||||
public unsafe void ClearRenderTargetDepthStencil(float depthValue, bool depthMask, int stencilValue, int stencilMask)
|
||||
public unsafe void ClearRenderTargetDepthStencil(int layer, float depthValue, bool depthMask, int stencilValue, int stencilMask)
|
||||
{
|
||||
// TODO: Use stencilMask (fully)
|
||||
|
||||
|
@ -205,7 +205,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
|
||||
var attachment = new ClearAttachment(flags, 0, clearValue);
|
||||
var clearRect = FramebufferParams?.GetClearRect(ClearScissor) ?? default;
|
||||
var clearRect = FramebufferParams?.GetClearRect(ClearScissor, layer) ?? default;
|
||||
|
||||
Gd.Api.CmdClearAttachments(CommandBuffer, 1, &attachment, 1, &clearRect);
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
_pendingQueryCopies.Clear();
|
||||
}
|
||||
|
||||
public void ClearRenderTargetColor(int index, uint componentMask, ColorF color)
|
||||
public void ClearRenderTargetColor(int index, int layer, uint componentMask, ColorF color)
|
||||
{
|
||||
if (FramebufferParams == null)
|
||||
{
|
||||
|
@ -68,6 +68,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
clearColor[2] = color.Blue;
|
||||
clearColor[3] = color.Alpha;
|
||||
|
||||
// TODO: Clear only the specified layer.
|
||||
Gd.HelperShader.Clear(
|
||||
Gd,
|
||||
dstTexture,
|
||||
|
@ -80,7 +81,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
else
|
||||
{
|
||||
ClearRenderTargetColor(index, color);
|
||||
ClearRenderTargetColor(index, layer, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue