From 4d1579acbf60ff23f14b591db762267f93092d0c Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
Date: Wed, 3 May 2023 21:20:12 -0300
Subject: Fix some invalid blits involving depth textures (#4723)

---
 src/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs')

diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs
index e93ea0c0..5d846222 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs
@@ -220,18 +220,18 @@ namespace Ryujinx.Graphics.Gpu.Image
         /// <param name="lhs">Texture information to compare</param>
         /// <param name="rhs">Texture information to compare with</param>
         /// <param name="forSampler">Indicates that the texture will be used for shader sampling</param>
-        /// <param name="forCopy">Indicates that the texture will be used as copy source or target</param>
+        /// <param name="depthAlias">Indicates if aliasing between color and depth format should be allowed</param>
         /// <returns>A value indicating how well the formats match</returns>
-        public static TextureMatchQuality FormatMatches(TextureInfo lhs, TextureInfo rhs, bool forSampler, bool forCopy)
+        public static TextureMatchQuality FormatMatches(TextureInfo lhs, TextureInfo rhs, bool forSampler, bool depthAlias)
         {
             // D32F and R32F texture have the same representation internally,
             // however the R32F format is used to sample from depth textures.
-            if (lhs.FormatInfo.Format == Format.D32Float && rhs.FormatInfo.Format == Format.R32Float && (forSampler || forCopy))
+            if (lhs.FormatInfo.Format == Format.D32Float && rhs.FormatInfo.Format == Format.R32Float && (forSampler || depthAlias))
             {
                 return TextureMatchQuality.FormatAlias;
             }
 
-            if (forCopy)
+            if (depthAlias)
             {
                 // The 2D engine does not support depth-stencil formats, so it will instead
                 // use equivalent color formats. We must also consider them as compatible.
-- 
cgit v1.2.3-70-g09d2