Log skipped DrawInstanced when SRV not bound #3382

Manually merged
github merged 1 commit from github-bot/gh-3380 into gh-pr/3380/base 2026-11-29 08:57:41 +00:00 AGit
Owner

@⁠KelboLive on GitHub · 2026-11-28 17:14 UTC · original
KelboLive:fix/black-screen-investigation → main · +5 −0 · 1 files · 1 commits · merged 2026-11-29 08:53 UTC

Problem

DrawInstanced calls are silently skipped when pass.srv_bound & 1 is false (root parameter 0 not bound), producing black screens with no diagnostic output. The code only increments a counter (render_draws_skipped) visible in periodic heartbeat reports, not during active rendering.

Fix

Add logging for the first 4 skip events showing which state flags were false:

  • pipeline_real: whether the pipeline has a desktop equivalent
  • targets_bound: whether render targets were successfully bound
  • topology_ok: whether primitive topology is valid (1–5)
  • srv_bound: the bitmask of root SRV parameters that reached the desktop list

This makes it immediately visible when SRV binding failures cause all draws to be skipped, helping diagnose black-screen issues.

Changes

  • src/startup_stubs/d3d12_xs_device.cpp: Added static LONG skipped counter and logging in the list_draw else branch (line ~4710).
**@⁠KelboLive** on GitHub · 2026-11-28 17:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3380) `KelboLive:fix/black-screen-investigation` → `main` · +5 −0 · 1 files · 1 commits · merged 2026-11-29 08:53 UTC ## Problem DrawInstanced calls are silently skipped when `pass.srv_bound & 1` is false (root parameter 0 not bound), producing black screens with no diagnostic output. The code only increments a counter (`render_draws_skipped`) visible in periodic heartbeat reports, not during active rendering. ## Fix Add logging for the first 4 skip events showing which state flags were false: - `pipeline_real`: whether the pipeline has a desktop equivalent - `targets_bound`: whether render targets were successfully bound - `topology_ok`: whether primitive topology is valid (1–5) - `srv_bound`: the bitmask of root SRV parameters that reached the desktop list This makes it immediately visible when SRV binding failures cause all draws to be skipped, helping diagnose black-screen issues. ## Changes - `src/startup_stubs/d3d12_xs_device.cpp`: Added `static LONG skipped` counter and logging in the `list_draw` else branch (line ~4710).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 17:14:53 +00:00
Author
Owner

@⁠Leyukaka on GitHub · 2026-11-29 07:12 UTC · original · approved these changes

Approve at bb9dfb62. Read from the diff and from main (212d4b5f) only; nothing was built or run.

The 5 added lines only log: the render_draws_skipped increment is unchanged. first_calls(skipped, 4) (local_log.h:45) stops at the limit with a compare-exchange, so at most 4 lines are printed. The format matches the field types: the three bool fields go through ? 1 : 0 to %d, and srv_bound is unsigned to %x. git merge-tree --write-tree origin/main has no conflicts. gh pr checks: the Windows build and test, the Linux Python checks and the fixture job pass; the /O2 build and the coverage chart are skipped.

Non-blocking: this else (d3d12_xs_device.cpp:4710 on main) is also taken when recording(self) is null, which happens when list_open is false (main:3001). When a list is recording without a desktop pipeline, the draw returns earlier (main:4680-4683). So pipeline_real=0 in this line can only appear when no list is recording. With a closed list, all four printed flags can be set and the line names no failing condition. Printing list != nullptr would cover that case.

No test is added; none is needed for a log line.

**@⁠Leyukaka** on GitHub · 2026-11-29 07:12 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3380#pullrequestreview-6101865190) · **approved these changes** Approve at bb9dfb62. Read from the diff and from main (212d4b5f) only; nothing was built or run. The 5 added lines only log: the `render_draws_skipped` increment is unchanged. `first_calls(skipped, 4)` (local_log.h:45) stops at the limit with a compare-exchange, so at most 4 lines are printed. The format matches the field types: the three `bool` fields go through `? 1 : 0` to `%d`, and `srv_bound` is `unsigned` to `%x`. `git merge-tree --write-tree origin/main` has no conflicts. `gh pr checks`: the Windows build and test, the Linux Python checks and the fixture job pass; the /O2 build and the coverage chart are skipped. Non-blocking: this `else` (d3d12_xs_device.cpp:4710 on main) is also taken when `recording(self)` is null, which happens when `list_open` is false (main:3001). When a list is recording without a desktop pipeline, the draw returns earlier (main:4680-4683). So `pipeline_real=0` in this line can only appear when no list is recording. With a closed list, all four printed flags can be set and the line names no failing condition. Printing `list != nullptr` would cover that case. No test is added; none is needed for a log line.
github-bot changed target branch from main to gh-pr/3380/base 2026-11-29 08:57:39 +00:00
github manually merged commit bb9dfb62ad into gh-pr/3380/base 2026-11-29 08:57:40 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.