Fix A1B5G5R5 format for good (#2955)

This commit is contained in:
gdkchan 2021-12-30 10:00:34 -03:00 committed by GitHub
parent b4f8ae7a75
commit 1485780d90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -72,7 +72,16 @@ namespace Ryujinx.Graphics.OpenGL.Image
(int)Info.SwizzleA.Convert()
};
if (Info.Format.IsBgr())
if (Info.Format == Format.A1B5G5R5Unorm)
{
int temp = swizzleRgba[0];
int temp2 = swizzleRgba[1];
swizzleRgba[0] = swizzleRgba[3];
swizzleRgba[1] = swizzleRgba[2];
swizzleRgba[2] = temp2;
swizzleRgba[3] = temp;
}
else if (Info.Format.IsBgr())
{
// Swap B <-> R for BGRA formats, as OpenGL has no support for them
// and we need to manually swap the components on read/write on the GPU.