aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-09-01 17:58:01 -0300
committerGitHub <noreply@github.com>2024-09-01 17:58:01 -0300
commitfdd7ee791cd37546390856f38eab16ea78451742 (patch)
treee4da2a50459f8d11c958207f0e4684a19d3e48fa
parent398fa1c238df75ee93f7106a578569f87cae8c0b (diff)
Fix incorrect depth texture 3D flag (#7262)1.1.1384
-rw-r--r--src/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClassState.cs8
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs8
2 files changed, 10 insertions, 6 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClassState.cs b/src/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClassState.cs
index dd55e7d1d..35051c6e0 100644
--- a/src/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClassState.cs
+++ b/src/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClassState.cs
@@ -415,7 +415,13 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
415#pragma warning disable CS0649 // Field is never assigned to 415#pragma warning disable CS0649 // Field is never assigned to
416 public int Width; 416 public int Width;
417 public int Height; 417 public int Height;
418 public int Depth; 418 public ushort Depth;
419 public ushort Flags;
420
421 public readonly bool UnpackIsLayered()
422 {
423 return (Flags & 1) == 0;
424 }
419#pragma warning restore CS0649 425#pragma warning restore CS0649
420 } 426 }
421 427
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
index b9ff060e2..b6fa842e3 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs
@@ -468,13 +468,11 @@ namespace Ryujinx.Graphics.Gpu.Image
468 int gobBlocksInY = dsState.MemoryLayout.UnpackGobBlocksInY(); 468 int gobBlocksInY = dsState.MemoryLayout.UnpackGobBlocksInY();
469 int gobBlocksInZ = dsState.MemoryLayout.UnpackGobBlocksInZ(); 469 int gobBlocksInZ = dsState.MemoryLayout.UnpackGobBlocksInZ();
470 470
471 layered &= size.UnpackIsLayered();
472
471 Target target; 473 Target target;
472 474
473 if (dsState.MemoryLayout.UnpackIsTarget3D()) 475 if ((samplesInX | samplesInY) != 1)
474 {
475 target = Target.Texture3D;
476 }
477 else if ((samplesInX | samplesInY) != 1)
478 { 476 {
479 target = size.Depth > 1 && layered 477 target = size.Depth > 1 && layered
480 ? Target.Texture2DMultisampleArray 478 ? Target.Texture2DMultisampleArray