From bc19114bb5a14f4563aa4bee68bda97234a7bcb0 Mon Sep 17 00:00:00 2001 From: sharmander Date: Mon, 31 Aug 2020 20:06:27 -0400 Subject: Fix: Issue #1475 Texture Compatibility Check methods need to be centralized (#1482) * Texture Compatibility Check methods need to be centralized #1475 * Fix spacing * Fix spacing * Undo removal of .ToString() * Move isPerfectMatch back to Texture.cs Rename parameters in TextureCompatibility.cs for consistency * Add switch from 1474 to TextureCompatibility as requested by mageven. * Actually add TextureCompatibility changes to the PR (Add DeriveDepthFormat method) * Alignment corrections + Derive method signature adjustment. * Removed empty line as erquested * Remove empty lines * Remove blank lines, fix alignment * Fix alignment * Remove emtpy line --- Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs') diff --git a/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs b/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs index af7ac038..8e92685b 100644 --- a/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs +++ b/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs @@ -1,4 +1,5 @@ using Ryujinx.Graphics.GAL; +using Ryujinx.Graphics.Gpu.Image; using Ryujinx.Graphics.Gpu.State; using System; @@ -28,16 +29,7 @@ namespace Ryujinx.Graphics.Gpu.Engine // When the source texture that was found has a depth format, // we must enforce the target texture also has a depth format, // as copies between depth and color formats are not allowed. - dstCopyTexture.Format = srcTexture.Format 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, - _ => dstCopyTexture.Format - }; + dstCopyTexture.Format = TextureCompatibility.DeriveDepthFormat(dstCopyTexture.Format, srcTexture.Format); Texture dstTexture = TextureManager.FindOrCreateTexture(dstCopyTexture, srcTexture.ScaleMode == Image.TextureScaleMode.Scaled); -- cgit v1.2.3