diff --git a/Ryujinx.Graphics.Vulkan/FormatCapabilities.cs b/Ryujinx.Graphics.Vulkan/FormatCapabilities.cs index 741d895652..0cac08bf8c 100644 --- a/Ryujinx.Graphics.Vulkan/FormatCapabilities.cs +++ b/Ryujinx.Graphics.Vulkan/FormatCapabilities.cs @@ -108,6 +108,10 @@ namespace Ryujinx.Graphics.Vulkan { format = VkFormat.D32SfloatS8Uint; } + else if (srcFormat == GAL.Format.R4G4B4A4Unorm) + { + format = VkFormat.R4G4B4A4UnormPack16; + } else { Logger.Error?.Print(LogClass.Gpu, $"Format {srcFormat} is not supported by the host."); diff --git a/Ryujinx.Graphics.Vulkan/FormatTable.cs b/Ryujinx.Graphics.Vulkan/FormatTable.cs index b5739623ce..45fc46ada9 100644 --- a/Ryujinx.Graphics.Vulkan/FormatTable.cs +++ b/Ryujinx.Graphics.Vulkan/FormatTable.cs @@ -6,11 +6,11 @@ namespace Ryujinx.Graphics.Vulkan { static class FormatTable { - private static readonly VkFormat[] Table; + private static readonly VkFormat[] _table; static FormatTable() { - Table = new VkFormat[Enum.GetNames(typeof(Format)).Length]; + _table = new VkFormat[Enum.GetNames(typeof(Format)).Length]; Add(Format.R8Unorm, VkFormat.R8Unorm); Add(Format.R8Snorm, VkFormat.R8SNorm); @@ -68,7 +68,7 @@ namespace Ryujinx.Graphics.Vulkan Add(Format.D32FloatS8Uint, VkFormat.D32SfloatS8Uint); Add(Format.R8G8B8A8Srgb, VkFormat.R8G8B8A8Srgb); Add(Format.R4G4Unorm, VkFormat.R4G4UnormPack8); - Add(Format.R4G4B4A4Unorm, VkFormat.R4G4B4A4UnormPack16); + Add(Format.R4G4B4A4Unorm, VkFormat.A4B4G4R4UnormPack16Ext); Add(Format.R5G5B5X1Unorm, VkFormat.A1R5G5B5UnormPack16); Add(Format.R5G5B5A1Unorm, VkFormat.A1R5G5B5UnormPack16); Add(Format.R5G6B5Unorm, VkFormat.R5G6B5UnormPack16); @@ -161,12 +161,12 @@ namespace Ryujinx.Graphics.Vulkan private static void Add(Format format, VkFormat vkFormat) { - Table[(int)format] = vkFormat; + _table[(int)format] = vkFormat; } public static VkFormat GetFormat(Format format) { - return Table[(int)format]; + return _table[(int)format]; } } } diff --git a/Ryujinx.Graphics.Vulkan/TextureView.cs b/Ryujinx.Graphics.Vulkan/TextureView.cs index 2eeafae9e4..fbe32eca9c 100644 --- a/Ryujinx.Graphics.Vulkan/TextureView.cs +++ b/Ryujinx.Graphics.Vulkan/TextureView.cs @@ -74,17 +74,7 @@ namespace Ryujinx.Graphics.Vulkan swizzleR = swizzleB; swizzleB = temp; } - else if (info.Format == GAL.Format.R4G4B4A4Unorm) - { - var tempG = swizzleG; - var tempB = swizzleB; - - swizzleB = swizzleA; - swizzleG = swizzleR; - swizzleR = tempG; - swizzleA = tempB; - } - else if (info.Format == GAL.Format.A1B5G5R5Unorm) + else if (VkFormat == VkFormat.R4G4B4A4UnormPack16 || info.Format == GAL.Format.A1B5G5R5Unorm) { var tempB = swizzleB; var tempA = swizzleA;