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

Merged
R0Y00 merged 3 commits from upstream-pr/1172 into main 2026-11-24 03:49:31 +00:00
R0Y00 commented 2026-11-24 02:26:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T02:26:19Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6573220674 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1172). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T02:26:19Z. --- 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.
tedin7 commented 2026-11-24 02:51:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T02:51:28Z.

Review: COMMENTED


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.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6032953122 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1172#pullrequestreview-6032953122). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T02:51:28Z. **Review:** COMMENTED --- 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 commented 2026-11-24 03:51:30 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T03:51:30Z.

Review: COMMENTED


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.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6033388570 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1172#pullrequestreview-6033388570). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T03:51:30Z. **Review:** COMMENTED --- 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`.
upstream-sync closed this pull request 2026-11-24 06:46:40 +00:00
denn0x commented 2026-11-24 06:50:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T03:30:35Z.


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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7121164627 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1172#issuecomment-7121164627). Originally posted by [denn0x](https://github.com/denn0x) on 2026-11-24T03:30:35Z. --- 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).
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
R0Y00/Xbox2Windows!1165
No description provided.