renderer: ignore inactive stencil registers for depth-only targets #425
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!425
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/425/head"
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?
@Techx3 on GitHub · 2026-08-31 13:06 UTC · original
Techx3:techx3/depth-only-inactive-stencil→main· +22 −15 · 3 files · 1 commits · merged 2026-08-31 18:39 UTCSummary
Treat
DB_STENCIL_INFO.format == kInvalidas the absence of a stencil plane when resolving a depth-only attachment. Retained stencil base addresses, Hi-Stencil compatibility and valid texture-compatibility state must not create a stencil attachment or abort a depth-only draw.This is general register-state handling, not a Bendy-specific workaround: there are no game IDs, shader hashes or lighting changes. The present-stencil branch is unchanged; missing or misaligned stencil backing, mismatched writable bases and invalid compression combinations remain fatal. Invalid register encodings and depth-address validation remain checked too.
The existing lowering already masks stencil testing, clears, guest ranges, Vulkan aspects and compressed-stencil metadata when the stencil format is invalid. The change removes the contradictory rejection of residual fields and retains a one-time diagnostic.
Public reference: AMD PAL's DepthStencilView::WriteCommandsCommon disables stencil by setting its format to zero for depth-only usage without clearing the other stencil state.
Validation
stencil state without an active stencil attachmentfatal (exit 321).VK_LAYER_KHRONOS_validation; no Vulkan validation errors reported.git diff --checkpasses. Full-game and non-Windows runtime compatibility are not claimed.The added tests cover D16/D32F, HTile on/off, all combinations of stale stencil addresses/Hi-Stencil/texture-compatibility state, real Vulkan depth clears/readback, valid active stencil, and exact fatal guards for invalid active stencil/depth states.
Scope
Independent branch from official
main, not stacked on the lighting changes in #423 or #424. Their isolated Bendy startup attempts stopped at the check corrected here. Full-game compatibility is not claimed.No Inspector, diagnostic tooling, captured game shaders, SDK files, HDR display presentation, FSR, import stubs or unrelated renderer/shader changes.