graphics: support stencil-only targets in TopSpin 2K25 #1879
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1879
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1879"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@spicchio72 on GitHub · 2026-10-24 14:16 UTC · original
spicchio72:codex/stencil-only-topspin→main· +490 −233 · 9 files · 4 commits · draftSummary
Support a restricted, uncompressed stencil-only guest attachment with a native
VK_FORMAT_S8_UINTimage, rather than requiring a depth address or dropping the attachment.TopSpin 2K25 (PPSA06899) supplied the observed state: invalid/absent Z format, S8 stencil enabled, depth testing/writes/bounds disabled, null Z read/write addresses, valid matching stencil addresses, and a 3840 x 2160 extent. The existing path rejects its null depth address before it can represent a stencil-only attachment.
Changes
stencil_only_targetGPU regression test: discovery, stencil-only attachment acquisition, upload, clear/readback, R8 sampled alias, separate storage backing and round trip, plus the observed 4K footprint.Scope and limitations
This addresses the initial stencil-only depth-target rejection reported in #1778. It does not establish that TopSpin 2K25 is stable or renders correctly overall; later guest access violations and separate image-conversion issues remain out of scope. Do not close the compatibility issue on this evidence alone.
The D16-to-wide-depth conversion, block-compressed view fixes, TLS/memory diagnostics and Astro Bot work are deliberately excluded.
Verification
Game evidence and incremental results: #1778 . Only the language/start-screen images there are stencil-only results. The gameplay image includes separate D16 and BC changes and is not evidence for this PR alone. This PR relates to #1778; it does not close it.
Patch isolated against upstream
8291cfeb04237a5e36f5d377e620cd0e6acd5805. Isolated Windows Release compilation passes.stencil_only_targetpasses withVK_LAYER_KHRONOS_validationloaded; the loader confirms instance and device layer insertion. Disabling just the new stencil-only dispatch reproduces the originalunsupported depth register state, and restoring it passes again.image_transfer_layoutandtexture_cache_depth_readbackalso pass.The complete suite is not claimed green:
texture_cache_image_viewsandtexture_cache_storage_sampledstop at unsupported D24S8 image usage (format=129, usage0x23) on this host. This was not reproduced on a completely unmodified build, so it must not be dismissed as a proven pre-existing failure. Rasterization cases are unavailable in the harness on the selected device; this test verifies attachment setup and data movement, not a complete stencil-tested draw. Seeverification.mdfor the exact scope and remaining review work.Submission preparation
The local submission checkout was formatted with the repository-pinned clang-format 22.1.3 and
src/.clang-format. Whole-file formatting also changes pre-existing formatting in the seven touched source files. Each formatted source was checked against formatter output on the original isolated candidate; no extra functional delta was found. Final emulator/test compilation passes using a hash-matched isolated verification source. The three focused tests listed above pass again with the validation-layer environment variable set. Fetch confirms upstream main still matches the recorded base. Seeformatting-review.md; this preparation is not a claim of completed human code review or complete regression coverage.AI assistance
Prepared with OpenAI Codex assistance and reviewed by me. Only the locally performed checks documented in the verification record are claimed; full game compatibility is not claimed.
@coderabbitai[bot] on GitHub · 2026-10-24 14:23 UTC · original
Walkthrough
The changes add support for stencil-only S8 depth targets. They validate target state, format, extent, backing range, and host attachment support, then extend image and descriptor handling for stencil aspects. A new host test checks target discovery, attachment state, upload and readback, aliases, and a 4K footprint. A CTest case runs the test through the
--stencil-onlyselector.Suggested reviewers:
nmzikPriority:
Normal
Change: Feature
Merge Risk:
Low · up to
e0442Hosts without optional S8 support cannot complete the new GPU test, and its storage round-trip check leaves a regression undetected. These are bounded test concerns to address or explicitly accept before merging.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 70 functions across 7 files. (2 skipped: 1 unsupported, 1 too large.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@ -15251,0 +15297,4 @@registers.SetStencilMask({});RenderDepthInfo stencil{};RenderExecutorTestAccess::ResolveRenderDepthTarget(executor, scheduler.Current(), stencil);@coderabbitai[bot] on GitHub · 2026-10-24 14:24 UTC · original
🔎 Supported by static analysis
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 14064
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 16921
Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 5016
Skip
stencil_only_targetwhen S8 attachment usage is unsupported.If the host rejects the
VK_FORMAT_S8_UINTimage-usage query, return a successful skip before callingResolveRenderDepthTarget.MakeStencilTargetDesccurrently callsDepthFatal, so the unconditionally registered CTest fails on valid Vulkan hosts without this optional format. This is an isolated test-workflow failure, so minor severity is proportionate.@coderabbitai[bot] on GitHub · 2026-10-24 14:24 UTC · original · reviewed
Actionable comments posted: 1
🧹 Nitpick comments: 1
ea54ae30-ed8f-4c13-8054-0b125a90d874Reviewing files that changed from the base of the PR and between
8291cfeb04ande0442deac1.CMakeLists.txtsrc/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/depthRenderTarget.cppsrc/graphics/host_gpu/renderer/image/image.cppsrc/graphics/host_gpu/renderer/image/image.hsrc/graphics/host_gpu/renderer/image/imageInfo.hsrc/graphics/host_gpu/renderer/image/imageView.cppsrc/graphics/host_gpu/renderer/pipeline/descriptors.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.