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

Open
opened 2026-11-22 10:18:53 +00:00 by Trwthh · 1 comment
Trwthh commented 2026-11-22 10:18:53 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by Trwthh on 2026-11-22T10:18:53Z.


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.

<!-- greyfinch-sync:omonkeyz/xbox-emulator:issue:6541203426 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/issues/111). Originally posted by [Trwthh](https://github.com/Trwthh) on 2026-11-22T10:18:53Z. --- ## 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.
omonkeyz commented 2026-11-22 14:05:27 +00:00 (Migrated from github.com)
Author

Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-22T14:05:27Z.


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.

<!-- greyfinch-sync:omonkeyz/xbox-emulator:comment:7080283861 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/issues/111#issuecomment-7080283861). Originally posted by [omonkeyz](https://github.com/omonkeyz) on 2026-11-22T14:05:27Z. --- 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.
Sign in to join this conversation.
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
omonkeyz/xbox-emulator#111
No description provided.