aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-11-05 19:50:34 -0300
committerGitHub <noreply@github.com>2020-11-05 23:50:34 +0100
commita89b81a81217016afe0403cfa389afe8181507dc (patch)
tree36d8597565ed2f9c09261ebd402d777b20fbc7b8 /Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
parent64088f04e369d5c5553bf2e21a1803068fc84960 (diff)
Separate zeta from color formats (#1647)
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs b/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
index 8e92685b..4856172a 100644
--- a/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/MethodCopyTexture.cs
@@ -19,7 +19,9 @@ namespace Ryujinx.Graphics.Gpu.Engine
var dstCopyTexture = state.Get<CopyTexture>(MethodOffset.CopyDstTexture);
var srcCopyTexture = state.Get<CopyTexture>(MethodOffset.CopySrcTexture);
- Texture srcTexture = TextureManager.FindOrCreateTexture(srcCopyTexture);
+ var srcCopyTextureFormat = srcCopyTexture.Format.Convert();
+
+ Texture srcTexture = TextureManager.FindOrCreateTexture(srcCopyTexture, srcCopyTextureFormat);
if (srcTexture == null)
{
@@ -29,9 +31,18 @@ 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 = TextureCompatibility.DeriveDepthFormat(dstCopyTexture.Format, srcTexture.Format);
+ FormatInfo dstCopyTextureFormat;
+
+ if (srcTexture.Format.IsDepthOrStencil())
+ {
+ dstCopyTextureFormat = srcCopyTextureFormat;
+ }
+ else
+ {
+ dstCopyTextureFormat = dstCopyTexture.Format.Convert();
+ }
- Texture dstTexture = TextureManager.FindOrCreateTexture(dstCopyTexture, srcTexture.ScaleMode == Image.TextureScaleMode.Scaled);
+ Texture dstTexture = TextureManager.FindOrCreateTexture(dstCopyTexture, dstCopyTextureFormat, srcTexture.ScaleMode == TextureScaleMode.Scaled);
if (dstTexture == null)
{
@@ -89,7 +100,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
{
srcCopyTexture.Height++;
- srcTexture = TextureManager.FindOrCreateTexture(srcCopyTexture, srcTexture.ScaleMode == Image.TextureScaleMode.Scaled);
+ srcTexture = TextureManager.FindOrCreateTexture(srcCopyTexture, srcCopyTextureFormat, srcTexture.ScaleMode == TextureScaleMode.Scaled);
if (srcTexture.ScaleFactor != dstTexture.ScaleFactor)
{
srcTexture.PropagateScale(dstTexture);