aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/Texture.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2022-01-11 08:37:40 +0000
committerGitHub <noreply@github.com>2022-01-11 09:37:40 +0100
commitef24c8983dc3971cd906568d337e49be694ee542 (patch)
treef3e2a13f1c29d4f2996d5d99746cfbdf2786dd5b /Ryujinx.Graphics.Gpu/Image/Texture.cs
parent275275f7ac1c365e84e36df4e4382d0ac64292af (diff)
Fix adjacent 3d texture slices being detected as Incompatible Overlaps (#2993)
This fixes some regressions caused by #2971 which caused rendered 3D texture data to be lost for most slices. Fixes issues with Xenoblade 2's colour grading, probably a ton of other games. This also removes the check from TextureCache, making it the tiniest bit smaller (any win is a win here).
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/Texture.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/Texture.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/Texture.cs b/Ryujinx.Graphics.Gpu/Image/Texture.cs
index ca43c430..eacfa4f5 100644
--- a/Ryujinx.Graphics.Gpu/Image/Texture.cs
+++ b/Ryujinx.Graphics.Gpu/Image/Texture.cs
@@ -1382,9 +1382,16 @@ namespace Ryujinx.Graphics.Gpu.Image
/// Determine if any of this texture's data overlaps with another.
/// </summary>
/// <param name="texture">The texture to check against</param>
+ /// <param name="compatibility">The view compatibility of the two textures</param>
/// <returns>True if any slice of the textures overlap, false otherwise</returns>
- public bool DataOverlaps(Texture texture)
+ public bool DataOverlaps(Texture texture, TextureViewCompatibility compatibility)
{
+ if (compatibility == TextureViewCompatibility.LayoutIncompatible && Info.GobBlocksInZ > 1 && Info.GobBlocksInZ == texture.Info.GobBlocksInZ)
+ {
+ // Allow overlapping slices of layout compatible 3D textures with matching GobBlocksInZ, as they are interleaved.
+ return false;
+ }
+
if (texture._sizeInfo.AllOffsets.Length == 1 && _sizeInfo.AllOffsets.Length == 1)
{
return Range.OverlapsWith(texture.Range);