From a89b81a81217016afe0403cfa389afe8181507dc Mon Sep 17 00:00:00 2001 From: gdkchan Date: Thu, 5 Nov 2020 19:50:34 -0300 Subject: Separate zeta from color formats (#1647) --- Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs | 44 +--------------------- 1 file changed, 1 insertion(+), 43 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs b/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs index b07aeaf1..6b85e49a 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs @@ -1,6 +1,5 @@ using Ryujinx.Common; using Ryujinx.Graphics.GAL; -using Ryujinx.Graphics.Gpu.State; using Ryujinx.Graphics.Texture; using System; @@ -88,26 +87,6 @@ namespace Ryujinx.Graphics.Gpu.Image return info.FormatInfo; } - /// - /// Finds the appropriate depth format for a copy texture if the source texture has a depth format. - /// - /// Destination CopyTexture Format - /// Source Texture Format - /// Derived RtFormat if srcTextureFormat is a depth format, otherwise return dstTextureFormat. - public static RtFormat DeriveDepthFormat(RtFormat dstTextureFormat, Format srcTextureFormat) - { - return srcTextureFormat switch - { - Format.S8Uint => RtFormat.S8Uint, - Format.D16Unorm => RtFormat.D16Unorm, - Format.D24X8Unorm => RtFormat.D24Unorm, - Format.D32Float => RtFormat.D32Float, - Format.D24UnormS8Uint => RtFormat.D24UnormS8Uint, - Format.D32FloatS8Uint => RtFormat.D32FloatS8Uint, - _ => dstTextureFormat - }; - } - /// /// Checks if two formats are compatible, according to the host API copy format compatibility rules. /// @@ -116,7 +95,7 @@ namespace Ryujinx.Graphics.Gpu.Image /// True if the formats are compatible, false otherwise public static bool FormatCompatible(FormatInfo lhs, FormatInfo rhs) { - if (IsDsFormat(lhs.Format) || IsDsFormat(rhs.Format)) + if (lhs.Format.IsDepthOrStencil() || rhs.Format.IsDepthOrStencil()) { return lhs.Format == rhs.Format; } @@ -567,26 +546,5 @@ namespace Ryujinx.Graphics.Gpu.Image return FormatClass.Unclassified; } - - /// - /// Checks if the format is a depth-stencil texture format. - /// - /// Format to check - /// True if the format is a depth-stencil format (including depth only), false otherwise - private static bool IsDsFormat(Format format) - { - switch (format) - { - case Format.D16Unorm: - case Format.D24X8Unorm: - case Format.D24UnormS8Uint: - case Format.D32Float: - case Format.D32FloatS8Uint: - case Format.S8Uint: - return true; - } - - return false; - } } } \ No newline at end of file -- cgit v1.2.3