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

@ -149,14 +149,14 @@ namespace Ryujinx.Graphics.Vulkan
return texture is TextureView view && view.Valid;
}
public ClearRect GetClearRect(Rectangle<int> scissor, int layer)
public ClearRect GetClearRect(Rectangle<int> scissor, int layer, int layerCount)
{
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)), (uint)layer, 1);
return new ClearRect(new Rect2D(new Offset2D(x, y), new Extent2D((uint)width, (uint)height)), (uint)layer, (uint)layerCount);
}
public unsafe Auto<DisposableFramebuffer> Create(Vk api, CommandBufferScoped cbs, Auto<DisposableRenderPass> renderPass)