If S8D24 is not supported, use D32FS8

This commit is contained in:
gdk 2022-06-13 22:30:17 -03:00 committed by riperiperi
parent 8cac0e2b51
commit ed681977f9
3 changed files with 9 additions and 5 deletions

View file

@ -69,11 +69,10 @@ namespace Ryujinx.Graphics.Vulkan
requiredFeatures |= FormatFeatureFlags.FormatFeatureStorageImageBit; requiredFeatures |= FormatFeatureFlags.FormatFeatureStorageImageBit;
} }
if (!FormatSupports(requiredFeatures, srcFormat) || if (!FormatSupports(requiredFeatures, srcFormat) || (IsD24S8(srcFormat) && VulkanConfiguration.ForceD24S8Unsupported))
(srcFormat == GAL.Format.D24UnormS8Uint && VulkanConfiguration.ForceD24S8Unsupported))
{ {
// The format is not supported. Can we convert it to a higher precision format? // The format is not supported. Can we convert it to a higher precision format?
if (srcFormat == GAL.Format.D24UnormS8Uint) if (IsD24S8(srcFormat))
{ {
format = VkFormat.D32SfloatS8Uint; format = VkFormat.D32SfloatS8Uint;
} }
@ -85,5 +84,10 @@ namespace Ryujinx.Graphics.Vulkan
return format; return format;
} }
public static bool IsD24S8(GAL.Format format)
{
return format == GAL.Format.D24UnormS8Uint || format == GAL.Format.S8UintD24Unorm;
}
} }
} }

View file

@ -399,7 +399,7 @@ namespace Ryujinx.Graphics.Vulkan
private bool NeedsD24S8Conversion() private bool NeedsD24S8Conversion()
{ {
return Info.Format == GAL.Format.D24UnormS8Uint && VkFormat == VkFormat.D32SfloatS8Uint; return FormatCapabilities.IsD24S8(Info.Format) && VkFormat == VkFormat.D32SfloatS8Uint;
} }
public void SetModification(AccessFlags accessFlags, PipelineStageFlags stage) public void SetModification(AccessFlags accessFlags, PipelineStageFlags stage)

View file

@ -964,7 +964,7 @@ namespace Ryujinx.Graphics.Vulkan
private bool NeedsD24S8Conversion() private bool NeedsD24S8Conversion()
{ {
return Info.Format == GAL.Format.D24UnormS8Uint && VkFormat == VkFormat.D32SfloatS8Uint; return FormatCapabilities.IsD24S8(Info.Format) && VkFormat == VkFormat.D32SfloatS8Uint;
} }
public void CopyFromOrToBuffer( public void CopyFromOrToBuffer(