Add capability for BGRA formats (#3011)

This commit is contained in:
gdkchan 2022-01-20 08:37:21 -03:00 committed by GitHub
parent 60f7cba30a
commit 0e59573f2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 1 deletions

View file

@ -167,6 +167,7 @@ namespace Ryujinx.Graphics.Shader.Translation
this.Copy(dest, src);
}
bool supportsBgra = Config.GpuAccessor.QueryHostSupportsBgraFormat();
int regIndexBase = 0;
for (int rtIndex = 0; rtIndex < 8; rtIndex++)
@ -185,7 +186,7 @@ namespace Ryujinx.Graphics.Shader.Translation
Operand src = Register(regIndexBase + component, RegisterType.Gpr);
// Perform B <-> R swap if needed, for BGRA formats (not supported on OpenGL).
if (component == 0 || component == 2)
if (!supportsBgra && (component == 0 || component == 2))
{
Operand isBgra = Attribute(AttributeConsts.FragmentOutputIsBgraBase + rtIndex * 4);