Fix A1B5G5R5 texture format and support R4G4 on Vulkan

This commit is contained in:
gdk 2022-04-14 23:19:28 -03:00 committed by riperiperi
parent 39467f7062
commit 2852ddf510
3 changed files with 12 additions and 1 deletions

View file

@ -68,6 +68,7 @@ namespace Ryujinx.Graphics.Vulkan
Add(Format.D32FloatS8Uint, VkFormat.D32SfloatS8Uint); Add(Format.D32FloatS8Uint, VkFormat.D32SfloatS8Uint);
Add(Format.R8G8B8X8Srgb, VkFormat.R8G8B8Srgb); Add(Format.R8G8B8X8Srgb, VkFormat.R8G8B8Srgb);
Add(Format.R8G8B8A8Srgb, VkFormat.R8G8B8A8Srgb); Add(Format.R8G8B8A8Srgb, VkFormat.R8G8B8A8Srgb);
Add(Format.R4G4Unorm, VkFormat.R4G4UnormPack8);
Add(Format.R4G4B4A4Unorm, VkFormat.R4G4B4A4UnormPack16); Add(Format.R4G4B4A4Unorm, VkFormat.R4G4B4A4UnormPack16);
Add(Format.R5G5B5X1Unorm, VkFormat.A1R5G5B5UnormPack16); Add(Format.R5G5B5X1Unorm, VkFormat.A1R5G5B5UnormPack16);
Add(Format.R5G5B5A1Unorm, VkFormat.A1R5G5B5UnormPack16); Add(Format.R5G5B5A1Unorm, VkFormat.A1R5G5B5UnormPack16);

View file

@ -84,6 +84,16 @@ namespace Ryujinx.Graphics.Vulkan
swizzleR = tempG; swizzleR = tempG;
swizzleA = tempB; swizzleA = tempB;
} }
else if (info.Format == GAL.Format.A1B5G5R5Unorm)
{
var tempB = swizzleB;
var tempA = swizzleA;
swizzleB = swizzleG;
swizzleA = swizzleR;
swizzleR = tempA;
swizzleG = tempB;
}
var componentMapping = new ComponentMapping(swizzleR, swizzleG, swizzleB, swizzleA); var componentMapping = new ComponentMapping(swizzleR, swizzleG, swizzleB, swizzleA);

View file

@ -310,7 +310,7 @@ namespace Ryujinx.Graphics.Vulkan
supportsAstcCompression: features.TextureCompressionAstcLdr, supportsAstcCompression: features.TextureCompressionAstcLdr,
supports3DTextureCompression: true, supports3DTextureCompression: true,
supportsBgraFormat: true, supportsBgraFormat: true,
supportsR4G4Format: false, supportsR4G4Format: FormatCapabilities.FormatSupports(GAL.Format.R4G4Unorm, FormatFeatureFlags.FormatFeatureSampledImageBit),
supportsFragmentShaderInterlock: SupportsFragmentShaderInterlock, supportsFragmentShaderInterlock: SupportsFragmentShaderInterlock,
supportsFragmentShaderOrderingIntel: false, supportsFragmentShaderOrderingIntel: false,
supportsGeometryShaderPassthrough: SupportsGeometryShaderPassthrough, supportsGeometryShaderPassthrough: SupportsGeometryShaderPassthrough,