From 7218f7281e324bef1e095feb9de2e078f4e6850d Mon Sep 17 00:00:00 2001 From: ParantezTech <12572227+par274@users.noreply.github.com> Date: Tue, 6 Oct 2026 14:51:41 +0300 Subject: [PATCH] [GPU] Accept stencil targets with or without HTile backing --- .../Gpu/Images/ImageRequestBuilders.DepthTarget.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/SharpEmu.Libs/Gpu/Images/ImageRequestBuilders.DepthTarget.cs b/src/SharpEmu.Libs/Gpu/Images/ImageRequestBuilders.DepthTarget.cs index 4c8b467..8a0c357 100644 --- a/src/SharpEmu.Libs/Gpu/Images/ImageRequestBuilders.DepthTarget.cs +++ b/src/SharpEmu.Libs/Gpu/Images/ImageRequestBuilders.DepthTarget.cs @@ -58,9 +58,6 @@ public static partial class ImageRequestBuilders return Format.Undefined; } - private static bool HtileStencilCompatible(bool hasStencil, bool hasHtile, bool htileStencilDisabled) => - !hasStencil || htileStencilDisabled || hasHtile; - // Builds the request for the bound depth target. Null when no depth or stencil state is active. public static DepthTargetResolution? DepthTarget(in DepthTargetWords depthWords, IImageFormatSupport device) => DepthTargetCore(in depthWords, device, copyMode: false, writeBuffer: false); @@ -128,7 +125,7 @@ public static partial class ImageRequestBuilders if (hasStencil) { - if (depthWords.StencilFormat != GuestStencilFormat.Stencil8UInt || !HtileStencilCompatible(hasStencil, hasHtile, depthWords.HtileStencilDisabled) || + if (depthWords.StencilFormat != GuestStencilFormat.Stencil8UInt || stencilAddress == 0 || (!copyMode && !depthWords.StencilWriteDisabled && depthWords.StencilWriteBase != depthWords.StencilReadBase) || (stencilAddress & 0xFFFF) != 0) { throw SubmissionScheduler.Fatal(