mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-02-21 00:23:36 +00:00
Fix backbuffer not being cleared and scissor not being re-enabled on OpenGL
This commit is contained in:
parent
6543531db8
commit
de87ed3edc
2 changed files with 27 additions and 5 deletions
|
@ -1116,12 +1116,32 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
{
|
||||
int vIndex = index * 4;
|
||||
|
||||
v[vIndex] = regions[index].X;
|
||||
v[vIndex + 1] = regions[index].Y;
|
||||
v[vIndex + 2] = regions[index].Width;
|
||||
v[vIndex + 3] = regions[index].Height;
|
||||
var region = regions[index];
|
||||
|
||||
GL.Enable(IndexedEnableCap.ScissorTest, index);
|
||||
bool enabled = (region.X | region.Y) != 0 || region.Width != 0xffff || region.Height != 0xffff;
|
||||
uint mask = 1u << index;
|
||||
|
||||
if (enabled)
|
||||
{
|
||||
v[vIndex] = region.X;
|
||||
v[vIndex + 1] = region.Y;
|
||||
v[vIndex + 2] = region.Width;
|
||||
v[vIndex + 3] = region.Height;
|
||||
|
||||
if ((_scissorEnables & mask) == 0)
|
||||
{
|
||||
_scissorEnables |= mask;
|
||||
GL.Enable(IndexedEnableCap.ScissorTest, index);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((_scissorEnables & mask) != 0)
|
||||
{
|
||||
_scissorEnables &= ~mask;
|
||||
GL.Disable(IndexedEnableCap.ScissorTest, index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL.ScissorArray(0, count, v);
|
||||
|
|
|
@ -106,6 +106,8 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
GL.Disable(EnableCap.RasterizerDiscard);
|
||||
GL.Disable(IndexedEnableCap.ScissorTest, 0);
|
||||
|
||||
GL.Clear(ClearBufferMask.ColorBufferBit);
|
||||
|
||||
int srcX0, srcX1, srcY0, srcY1;
|
||||
float scale = view.ScaleFactor;
|
||||
|
||||
|
|
Loading…
Reference in a new issue