diff options
author | gdkchan <gab.dark.100@gmail.com> | 2022-01-16 20:23:00 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-16 20:23:00 -0300 |
commit | fb853f13e92be33a2b75984cbb5c3921a9660019 (patch) | |
tree | 616e61a8ab356855520ca30d299a217739a8253d | |
parent | 929a97d432d98b4270a78cb668d543c23cc2836a (diff) |
Scale scissor used for clears (#3002)
-rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs | 9 | ||||
-rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs b/Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs index b705d63e..76141215 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs @@ -535,6 +535,15 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed scissorH = Math.Min(scissorH, scissorState.Y2 - scissorState.Y1); } + float scale = _channel.TextureManager.RenderTargetScale; + if (scale != 1f) + { + scissorX = (int)(scissorX * scale); + scissorY = (int)(scissorY * scale); + scissorW = (int)MathF.Ceiling(scissorW * scale); + scissorH = (int)MathF.Ceiling(scissorH * scale); + } + _context.Renderer.Pipeline.SetScissor(0, true, scissorX, scissorY, scissorW, scissorH); } diff --git a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs index 1228a944..1a9aeb44 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs @@ -477,8 +477,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed { x = (int)(x * scale); y = (int)(y * scale); - width = (int)Math.Ceiling(width * scale); - height = (int)Math.Ceiling(height * scale); + width = (int)MathF.Ceiling(width * scale); + height = (int)MathF.Ceiling(height * scale); } _context.Renderer.Pipeline.SetScissor(index, true, x, y, width, height); |