Clamp ScissorRect
This commit is contained in:
parent
fcc7cb55df
commit
de86f20b94
2 changed files with 5 additions and 5 deletions
|
@ -539,7 +539,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
public unsafe void SetScissors(ReadOnlySpan<Rectangle<int>> regions)
|
||||
{
|
||||
int maxScissors = Math.Min(regions.Length, _renderEncoderState.ViewportCount);
|
||||
int maxScissors = Math.Min(regions.Length, _renderEncoderState.Viewports.Length);
|
||||
|
||||
if (maxScissors == 0)
|
||||
{
|
||||
|
@ -554,8 +554,8 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
mtlScissorRects[i] = new MTLScissorRect
|
||||
{
|
||||
height = (ulong)region.Height,
|
||||
width = (ulong)region.Width,
|
||||
height = Math.Clamp((ulong)region.Height, 0, (ulong)_renderEncoderState.Viewports[i].height),
|
||||
width = Math.Clamp((ulong)region.Width, 0, (ulong)_renderEncoderState.Viewports[i].width),
|
||||
x = (ulong)region.X,
|
||||
y = (ulong)region.Y
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue