From 8dbcae1ff88927dc0734d5f0e24fbf8781d68590 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 26 Jul 2020 00:03:40 -0300 Subject: Implement BGRA texture support (#1418) * Implement BGRA texture support * Missing AppendLine * Remove empty lines * Address PR feedback --- Ryujinx.Graphics.GAL/Format.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Ryujinx.Graphics.GAL/Format.cs') diff --git a/Ryujinx.Graphics.GAL/Format.cs b/Ryujinx.Graphics.GAL/Format.cs index 19939c38..a6667361 100644 --- a/Ryujinx.Graphics.GAL/Format.cs +++ b/Ryujinx.Graphics.GAL/Format.cs @@ -230,6 +230,25 @@ namespace Ryujinx.Graphics.GAL return false; } + /// + /// Checks if the texture format is a BGRA format with 8-bit components. + /// + /// Texture format + /// True if the texture format is a BGRA format with 8-bit components, false otherwise + public static bool IsBgra8(this Format format) + { + switch (format) + { + case Format.B8G8R8X8Unorm: + case Format.B8G8R8A8Unorm: + case Format.B8G8R8X8Srgb: + case Format.B8G8R8A8Srgb: + return true; + } + + return false; + } + /// /// Checks if the texture format is a depth, stencil or depth-stencil format. /// -- cgit v1.2.3