Fix render target clear when sizes mismatch (#2994)

This commit is contained in:
gdkchan 2022-01-11 16:15:17 -03:00 committed by GitHub
parent ef24c8983d
commit 6e0799580f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 181 additions and 25 deletions

View file

@ -6,7 +6,6 @@ using Ryujinx.Graphics.OpenGL.Queries;
using Ryujinx.Graphics.Shader;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Ryujinx.Graphics.OpenGL
{
@ -1058,14 +1057,17 @@ namespace Ryujinx.Graphics.OpenGL
_framebuffer.AttachColor(index, color);
int isBgra = color != null && color.Format.IsBgr() ? 1 : 0;
if (_fpIsBgra[index].X != isBgra)
if (color != null)
{
_fpIsBgra[index].X = isBgra;
isBgraChanged = true;
int isBgra = color.Format.IsBgr() ? 1 : 0;
RestoreComponentMask(index);
if (_fpIsBgra[index].X != isBgra)
{
_fpIsBgra[index].X = isBgra;
isBgraChanged = true;
RestoreComponentMask(index);
}
}
}