Capture every visible render-target pixel after the submitting queue fence #1172

Manually merged
github merged 3 commits from gh-pr/1172/head into gh-pr/1172/base 2026-11-26 22:46:05 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 02:26 UTC · original
R0Y00:codex/startup-draw-capture → main · +374 −48 · 8 files · 3 commits · merged 2026-11-24 03:49 UTC

Refs #1137. Depends on #1135. This review base pins its corrected CI commit 5691fe81. Retarget to main after the parent lands.

The diagnostic previously sampled every fourth texel, inferred pixel size from aligned row pitch and mapped after a fixed number of presents. All three can invalidate a black-frame diagnosis. The change retains the readback until the actual submitting queue completes, drops abandoned recordings and writes full-resolution single-sample RGBA8/BGRA8 UNORM and sRGB BMPs. The file count reflects successful writes. Final publication requires a subsequent present.

Windows 11 build 26200.9974, Release, debug layer off. ctest --test-dir out/verify --no-tests=error -R 'startup_(draw_bmp|dump_fence)' -V passed both registered tests. The fence fixture cancelled two recordings and published one submitted copy with value 0x9df81342. The BMP fixture checks all 21 pixels of a padded 7×3 image with one bright pixel between the old sample points, both channel layouts and both transfer encodings, plus rejection of a short row and unsupported format. These checks validate the capture path; the first black draw from the application remains under investigation.

**@⁠R0Y00** on GitHub · 2026-11-24 02:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1172) `R0Y00:codex/startup-draw-capture` → `main` · +374 −48 · 8 files · 3 commits · merged 2026-11-24 03:49 UTC Refs #1137. Depends on #1135. This review base pins its corrected CI commit 5691fe81. Retarget to main after the parent lands. The diagnostic previously sampled every fourth texel, inferred pixel size from aligned row pitch and mapped after a fixed number of presents. All three can invalidate a black-frame diagnosis. The change retains the readback until the actual submitting queue completes, drops abandoned recordings and writes full-resolution single-sample RGBA8/BGRA8 UNORM and sRGB BMPs. The file count reflects successful writes. Final publication requires a subsequent present. Windows 11 build 26200.9974, Release, debug layer off. `ctest --test-dir out/verify --no-tests=error -R 'startup_(draw_bmp|dump_fence)' -V` passed both registered tests. The fence fixture cancelled two recordings and published one submitted copy with value `0x9df81342`. The BMP fixture checks all 21 pixels of a padded 7×3 image with one bright pixel between the old sample points, both channel layouts and both transfer encodings, plus rejection of a short row and unsupported format. These checks validate the capture path; the first black draw from the application remains under investigation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:46:04 +00:00
github manually merged commit 3e8b339118 into gh-pr/1172/base 2026-11-26 22:46:05 +00:00
Author
Owner

@⁠denn0x on GitHub · 2026-11-24 03:30 UTC · original

Test report for 0549d05c: Windows 11 Pro 26300, MSVC 14.50 (VS 18 Build Tools), Ninja, Release, debug layer off.

  • cmake --build out/build/release: built with no errors or failures.
  • ctest --no-tests=error -R startup: 7/7 passed, 0 failed, no skips.

Not tested yet: a run with the console executable. Runs on this machine currently run out of system commit before the menus (#1199). I will add the executable result here once that is resolved.

AI-assisted (Claude Code).

**@⁠denn0x** on GitHub · 2026-11-24 03:30 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1172#issuecomment-7121164627) Test report for `0549d05c`: Windows 11 Pro 26300, MSVC 14.50 (VS 18 Build Tools), Ninja, Release, debug layer off. - `cmake --build out/build/release`: built with no errors or failures. - `ctest --no-tests=error -R startup`: 7/7 passed, 0 failed, no skips. Not tested yet: a run with the console executable. Runs on this machine currently run out of system commit before the menus (#1199). I will add the executable result here once that is resolved. AI-assisted (Claude Code).
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 02:51 UTC · original · reviewed

Review of 0549d05cf241e398edc72757d2b075ead2d20805 (Linux, scoped to cc147c2f..0549d05c):

  • src/startup_stubs/draw_dump_tracking.h + d3d12_xs_device.cpp + d3d12_draw.inl: DrawReadbacks cleanly separates command-list recording lifetime from submission via discard() on reset and a per-submission queue fence in execute(), guarding against UINT64_MAX (device removal) in take_completed().
  • src/startup_stubs/draw_bmp.h: writes full-resolution 32-bit BMPs for single-sample {R8G8B8A8,B8G8R8A8}_UNORM{_SRGB} targets with row-pitch handling and size overflow checks.
  • tests/startup_draw_bmp.cpp and tests/startup_dump_fence.cpp: cover pitch padding, format rejection, discarded/unsubmitted lists, unrelated queues, and gated fence completion.
  • Linux checks run and passed: py_compile on tests/startup_stub_check.py and tools/startup/*.py, docs_links_check.py (253 links), bidi_controls_check.py (969 files), gpu_report_format_check.py (10 tests), and xgameruntime_table_check.py.
  • Note: no CI checks are reported on this branch yet, and Windows MSVC build + startup_draw_bmp / startup_dump_fence_warp execution rely on CI.
**@⁠tedin7** on GitHub · 2026-11-24 02:51 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1172#pullrequestreview-6032953122) · **reviewed** Review of `0549d05cf241e398edc72757d2b075ead2d20805` (Linux, scoped to `cc147c2f`..`0549d05c`): - `src/startup_stubs/draw_dump_tracking.h` + `d3d12_xs_device.cpp` + `d3d12_draw.inl`: `DrawReadbacks` cleanly separates command-list recording lifetime from submission via `discard()` on reset and a per-submission queue fence in `execute()`, guarding against `UINT64_MAX` (device removal) in `take_completed()`. - `src/startup_stubs/draw_bmp.h`: writes full-resolution 32-bit BMPs for single-sample `{R8G8B8A8,B8G8R8A8}_UNORM{_SRGB}` targets with row-pitch handling and size overflow checks. - `tests/startup_draw_bmp.cpp` and `tests/startup_dump_fence.cpp`: cover pitch padding, format rejection, discarded/unsubmitted lists, unrelated queues, and gated fence completion. - Linux checks run and passed: `py_compile` on `tests/startup_stub_check.py` and `tools/startup/*.py`, `docs_links_check.py` (253 links), `bidi_controls_check.py` (969 files), `gpu_report_format_check.py` (10 tests), and `xgameruntime_table_check.py`. - Note: no CI checks are reported on this branch yet, and Windows MSVC build + `startup_draw_bmp` / `startup_dump_fence_warp` execution rely on CI.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 03:51 UTC · original · reviewed

Retest on Linux at commit 3e8b3391 (delta 0549d05c..3e8b3391; Windows build/tests were not executed locally).

Findings

  • Rebased onto main (9dee245d), with 3e8b3391 as an empty commit (ci: run start-up draw checks on the main pull request).
  • All 8 PR files (CMakeLists.txt, docs/startup-runtime.md, src/startup_stubs/d3d12_draw.inl, src/startup_stubs/d3d12_xs_device.cpp, src/startup_stubs/draw_bmp.h, src/startup_stubs/draw_dump_tracking.h, tests/startup_draw_bmp.cpp, tests/startup_dump_fence.cpp) are unchanged in behavior from 0549d05c; no new issues found.

Checks run (Linux, 3e8b3391)

  • /root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py: passed (16 Markdown files, 269 links).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py: passed (1009 tracked files).
  • /root/.local/share/x2w-rev-venv/bin/python -B tests/gpu_report_format_check.py: Ran 10 tests in 0.005s — OK.
**@⁠tedin7** on GitHub · 2026-11-24 03:51 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1172#pullrequestreview-6033388570) · **reviewed** Retest on Linux at commit `3e8b3391` (delta `0549d05c..3e8b3391`; Windows build/tests were **not** executed locally). ### Findings - Rebased onto `main` (`9dee245d`), with `3e8b3391` as an empty commit (`ci: run start-up draw checks on the main pull request`). - All 8 PR files (`CMakeLists.txt`, `docs/startup-runtime.md`, `src/startup_stubs/d3d12_draw.inl`, `src/startup_stubs/d3d12_xs_device.cpp`, `src/startup_stubs/draw_bmp.h`, `src/startup_stubs/draw_dump_tracking.h`, `tests/startup_draw_bmp.cpp`, `tests/startup_dump_fence.cpp`) are unchanged in behavior from `0549d05c`; no new issues found. ### Checks run (Linux, `3e8b3391`) - `/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py`: passed (`16` Markdown files, `269` links). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py`: passed (`1009` tracked files). - `/root/.local/share/x2w-rev-venv/bin/python -B tests/gpu_report_format_check.py`: `Ran 10 tests in 0.005s` — `OK`.
This discussion has been locked. Commenting is limited to contributors.
No description provided.