d3d12_xs: occlusion query results always zero — objects incorrectly culled #111

Open
opened 2026-11-26 06:10:33 +00:00 by github-bot · 1 comment
Owner

@⁠Trwthh on GitHub · 2026-11-22 10:18 UTC · original

Bug

All sampled GPU occlusion query results return 0, causing the title's GPU occlusion culling to treat everything as invisible. This is documented in BLOCKERS.md (run 33) but not tracked as an issue.

Evidence (from run 33 diagnostics)

  • Occlusion boxes (VS f89dddcf70078d07) reach clipping (CPrimitives 10-12 of 12)
  • PSInvocations is 0 — the pixel shader never runs for the query boxes
  • No samples pass, so all query results are 0
  • Viewport and scissor are full screen (not the cause)

Suspects (per BLOCKERS.md)

  • Depth-bounds or depth/stencil state in the PSO translation
  • Sample mask set to 0
  • The box PSO is not registered in the diag, so its creation path is not hooked

Impact

High. This is why the Fortnite lobby 3D backdrop never draws — the scenery around the character is culled because every query says "not visible." The character and floor draw because they bypass occlusion culling. Run 27 fixed the nested occlusion query issue, but query results are still all zero.

Expected behaviour

Occlusion query boxes should produce nonzero PSInvocations when they overlap visible depth, so the title's culling lets far objects through.

**@⁠Trwthh** on GitHub · 2026-11-22 10:18 UTC · [original](https://github.com/omonkeyz/xbox-emulator/issues/111) ## Bug All sampled GPU occlusion query results return 0, causing the title's GPU occlusion culling to treat everything as invisible. This is documented in BLOCKERS.md (run 33) but not tracked as an issue. ### Evidence (from run 33 diagnostics) - Occlusion boxes (VS `f89dddcf70078d07`) reach clipping (CPrimitives 10-12 of 12) - **PSInvocations is 0** — the pixel shader never runs for the query boxes - No samples pass, so all query results are 0 - Viewport and scissor are full screen (not the cause) ### Suspects (per BLOCKERS.md) - Depth-bounds or depth/stencil state in the PSO translation - Sample mask set to 0 - The box PSO is not registered in the diag, so its creation path is not hooked ### Impact **High.** This is why the Fortnite lobby 3D backdrop never draws — the scenery around the character is culled because every query says "not visible." The character and floor draw because they bypass occlusion culling. Run 27 fixed the nested occlusion query issue, but query results are still all zero. ### Expected behaviour Occlusion query boxes should produce nonzero PSInvocations when they overlap visible depth, so the title's culling lets far objects through.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:10:33 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-22 14:05 UTC · original

Notes from an offline check: the 'always zero' data is from run 33. In docs/BLOCKERS.md, run 35 has only 17% zero results and the backdrop draws, while runs 39-40 are about 97% zero with identical proxy-box diagnostics, so the scene may explain that. PSInvocations = 0 alone does not prove a bug, since depth-only query boxes with colour writes off can skip the PS. The occlusion counting (dbcount.rs) is checked exactly on hardware tests. Next step is a capture of the box PSO's depth/stencil state and sample mask in a lobby run. Leaving this open.

**@⁠omonkeyz** on GitHub · 2026-11-22 14:05 UTC · [original](https://github.com/omonkeyz/xbox-emulator/issues/111#issuecomment-7080283861) Notes from an offline check: the 'always zero' data is from run 33. In docs/BLOCKERS.md, run 35 has only 17% zero results and the backdrop draws, while runs 39-40 are about 97% zero with identical proxy-box diagnostics, so the scene may explain that. PSInvocations = 0 alone does not prove a bug, since depth-only query boxes with colour writes off can skip the PS. The occlusion counting (dbcount.rs) is checked exactly on hardware tests. Next step is a capture of the box PSO's depth/stencil state and sample mask in a lobby run. Leaving this open.
This discussion has been locked. Commenting is limited to contributors.
No description provided.