d3d12: support separate front/back stencil masks in DEPTH_STENCIL2 streams #799

Closed
kotekompotek wants to merge 1 commit from upstream-pr/799 into main
kotekompotek commented 2026-11-24 13:59:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-24T13:59:10Z.


Claimed in the coordination issue as: coordination issue #14

What and why

  • Rebased onto current main.
  • Supported separate front/back stencil read and write masks in D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 streams (runtime/shims/d3d12_vulkan_device.cpp), added stream test cases in runtime/test/d3d12_bundle_test.cpp, and synced docs/d3d12_vulkan.md.

Tested

  • Built d3d12_com_test and ran ctest -R ^d3d12_com$ (Passed, 1.65s). (d3d12_bundle_test requires glslangValidator, which is not installed in this local environment.)

GPUs tested: NVIDIA GeForce GTX 1050 (driver 582.28, Windows)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5473571706 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/799). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-24T13:59:10Z. --- Claimed in the coordination issue as: coordination issue #14 ### What and why - Rebased onto current `main`. - Supported separate front/back stencil read and write masks in `D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2` streams (`runtime/shims/d3d12_vulkan_device.cpp`), added stream test cases in `runtime/test/d3d12_bundle_test.cpp`, and synced `docs/d3d12_vulkan.md`. ### Tested - Built `d3d12_com_test` and ran `ctest -R ^d3d12_com$` (`Passed`, 1.65s). (`d3d12_bundle_test` requires `glslangValidator`, which is not installed in this local environment.) GPUs tested: NVIDIA GeForce GTX 1050 (driver 582.28, Windows) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
aslan2142 commented 2026-11-24 19:50:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-24T19:50:32Z.


Thanks for working on this, @kotekompotek. I'm closing this in favour of #878, which fixes the same refusal:

  • Both PRs send the back face's masks to depth.back correctly, so the device code is equivalent.
  • #878 also sets OPTIONS14.IndependentFrontAndBackStencilRefMaskSupported to TRUE. This PR accepts different face masks but still reports the cap as FALSE.
  • The new d3d12_bundle_test block binds no depth-stencil view and uses KEEP/ALWAYS, so the stencil test never runs. It would also pass if the back masks were ignored. #878 compares 16 per-face mask and reference cases with the host D3D12 device, and those cases fail when the back face gets the front face's masks.
  • #878 also had the earlier claim for D3D-STENCIL-FACE-MASKS in #14.

Your review of #878 is very welcome if you spot anything it misses.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7142665062 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/799#issuecomment-7142665062). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-24T19:50:32Z. --- Thanks for working on this, @kotekompotek. I'm closing this in favour of #878, which fixes the same refusal: - Both PRs send the back face's masks to `depth.back` correctly, so the device code is equivalent. - #878 also sets `OPTIONS14.IndependentFrontAndBackStencilRefMaskSupported` to TRUE. This PR accepts different face masks but still reports the cap as FALSE. - The new `d3d12_bundle_test` block binds no depth-stencil view and uses KEEP/ALWAYS, so the stencil test never runs. It would also pass if the back masks were ignored. #878 compares 16 per-face mask and reference cases with the host D3D12 device, and those cases fail when the back face gets the front face's masks. - #878 also had the earlier claim for D3D-STENCIL-FACE-MASKS in #14. Your review of #878 is very welcome if you spot anything it misses. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!799
No description provided.