Selaa lähdekoodia

Add missing depth-color conversions in CopyTexture (#1474)

* Add missing depth-color conversions in CopyTexture

* Whitespace

* switch expression
mageven 5 vuotta sitten
vanhempi
sitoutus
2a314f3c28
1 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 9 3
      Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs

+ 9 - 3
Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs

@@ -28,10 +28,16 @@ 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.
-            if (srcTexture.Format == Format.D32Float)
+            dstCopyTexture.Format = srcTexture.Format switch
             {
-                dstCopyTexture.Format = RtFormat.D32Float;
-            }
+                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
+            };
 
             Texture dstTexture = TextureManager.FindOrCreateTexture(dstCopyTexture, srcTexture.ScaleMode == Image.TextureScaleMode.Scaled);