From b4d0f10568214e25f07b738175f39f14c7583fbc Mon Sep 17 00:00:00 2001 From: KeatonTheBot Date: Wed, 4 Mar 2026 16:43:46 -0600 Subject: [PATCH] Vulkan: Add A8B8G8R8 texture format Co-authored-by: Stossy11 --- src/Ryujinx.Graphics.GAL/Format.cs | 3 +++ src/Ryujinx.Graphics.Gpu/Image/FormatTable.cs | 2 ++ src/Ryujinx.Graphics.Vulkan/FormatCapabilities.cs | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/Ryujinx.Graphics.GAL/Format.cs b/src/Ryujinx.Graphics.GAL/Format.cs index dbd3cb461..9d0ae5a57 100644 --- a/src/Ryujinx.Graphics.GAL/Format.cs +++ b/src/Ryujinx.Graphics.GAL/Format.cs @@ -149,6 +149,7 @@ namespace Ryujinx.Graphics.GAL B8G8R8A8Srgb, B10G10R10A2Unorm, X8UintD24Unorm, + A8B8G8R8Uint, } public static class FormatExtensions @@ -183,6 +184,7 @@ namespace Ryujinx.Graphics.GAL case Format.R8G8B8A8Snorm: case Format.R8G8B8A8Uint: case Format.R8G8B8A8Sint: + case Format.A8B8G8R8Uint: case Format.R8G8B8A8Srgb: case Format.R4G4Unorm: case Format.R8Uscaled: @@ -656,6 +658,7 @@ namespace Ryujinx.Graphics.GAL case Format.R32Uint: case Format.R8G8Uint: case Format.R16G16Uint: + case Format.A8B8G8R8Uint: case Format.R32G32Uint: case Format.R8G8B8Uint: case Format.R16G16B16Uint: diff --git a/src/Ryujinx.Graphics.Gpu/Image/FormatTable.cs b/src/Ryujinx.Graphics.Gpu/Image/FormatTable.cs index da9e5c3a9..085d72e3d 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/FormatTable.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/FormatTable.cs @@ -361,6 +361,7 @@ namespace Ryujinx.Graphics.Gpu.Image A2B10G10R10Sint = (A2B10G10R10 << 21) | (Sint << 27), // 0x1e000000 A2B10G10R10Uscaled = (A2B10G10R10 << 21) | (Uscaled << 27), // 0x2e000000 A2B10G10R10Sscaled = (A2B10G10R10 << 21) | (Sscaled << 27), // 0x36000000 + A8B8G8R8Uint = (A8B8G8R8 << 21) | (Uint << 27), // 0x25e00040 } private static readonly Dictionary _textureFormats = new() @@ -556,6 +557,7 @@ namespace Ryujinx.Graphics.Gpu.Image { VertexAttributeFormat.A2B10G10R10Sint, Format.R10G10B10A2Sint }, { VertexAttributeFormat.A2B10G10R10Uscaled, Format.R10G10B10A2Uscaled }, { VertexAttributeFormat.A2B10G10R10Sscaled, Format.R10G10B10A2Sscaled }, + { VertexAttributeFormat.A8B8G8R8Uint, Format.A8B8G8R8Uint }, }; #pragma warning restore IDE0055 diff --git a/src/Ryujinx.Graphics.Vulkan/FormatCapabilities.cs b/src/Ryujinx.Graphics.Vulkan/FormatCapabilities.cs index d09a10c17..4f7244c8a 100644 --- a/src/Ryujinx.Graphics.Vulkan/FormatCapabilities.cs +++ b/src/Ryujinx.Graphics.Vulkan/FormatCapabilities.cs @@ -211,6 +211,9 @@ namespace Ryujinx.Graphics.Vulkan case Format.R16G16B16Uint: format = VkFormat.R16G16B16A16Uint; break; + case Format.A8B8G8R8Uint: + format = VkFormat.A8B8G8R8UintPack32; + break; default: Logger.Error?.Print(LogClass.Gpu, $"Format {srcFormat} is not supported by the host."); break;