startup: copy and resolve whole resources on a recording list (slots 15, 17, 19) #1811

Closed
github-bot wants to merge 1 commit from gh-pr/1811/head into gh-pr/1811/base
Owner

@⁠tedin7 on GitHub · 2026-11-24 19:04 UTC · original
tedin7:x2w-frontier-list-copy → main · +804 −0 · 7 files · 1 commits · closed without merging

Related to #870 (no Fixes).

What changes

In render mode, three command-list slots that were dropped now copy whole resources:

  • slot 15 CopyBufferRegion, slot 17 CopyResource, slot 19 ResolveSubresource (unshifted, like slots 12 to 25).
  • Each argument is mapped to its desktop resource. The pair moves to COPY_SOURCE/COPY_DEST or RESOLVE_SOURCE/RESOLVE_DEST for the call and back to COMMON at Close. An upload buffer stays readable and a readback buffer stays a copy destination.
  • A call the desktop would reject is counted, logged (first six) and not forwarded, with a named reason (size_mismatch, sample_mismatch, range_overflow, source_not_multisampled, ...). Calls on a closed list are ignored.
  • A typeless resolve format resolves as the family's typed choice (half float for R16G16B16A16, as in #1729; normalised for the 8-bit and 10-bit families). One with no single choice (for example R16_TYPELESS) is refused as bad_format.
  • x2w_d3d12_list_copy_stats exports the counters for fixtures.
  • CopyTextureRegion (16) and CopyTiles (18) are left out on purpose.

Code is in new files: src/startup_stubs/list_copy.h (pure checks) and list_copy.inl (handlers). d3d12_xs_device.cpp gets one include of each, plus three install lines after the slot 52 line.

These slots have not been seen in a title log yet; the placement follows the unshifted slot order.

Checks run locally (Linux)

g++ -std=c++17 -Wall -Wextra -Isrc -I/usr/include/directx -I/usr/include/wsl/stubs -include wsl/winadapter.h tests/startup_list_copy_check.cpp
./a.out   # ok; --mutate overflow, typeless, samples each fail
x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only -Isrc tests/startup_list_copy.cpp
x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only ... src/startup_stubs/d3d12_xs_device.cpp   # only the two __try/__except errors of local_log.h, none from the new code
git diff --check
python3 -B tests/docs_links_check.py
python3 -B tests/bidi_controls_check.py
git merge-tree --write-tree HEAD <ref>   # origin/main, #1726, #1787, #1788, #1799, #1800, #1803: no conflicts

Not run

startup_list_copy_{warp,hardware} and the new device code have not been built or run; they need Windows. The fixture records on one list: clear and copy, a swapped copy (the empty texture stays empty), a 4-sample resolve, a typeless half-float resolve, two buffer copies with offsets, four refused calls (size mismatch, null source, one-sample resolve source, range past the end) and calls on a closed list, then reads everything back and checks the debug layer.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 19:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1811) `tedin7:x2w-frontier-list-copy` → `main` · +804 −0 · 7 files · 1 commits · closed without merging Related to #870 (no `Fixes`). ## What changes In render mode, three command-list slots that were dropped now copy whole resources: - slot 15 `CopyBufferRegion`, slot 17 `CopyResource`, slot 19 `ResolveSubresource` (unshifted, like slots 12 to 25). - Each argument is mapped to its desktop resource. The pair moves to `COPY_SOURCE`/`COPY_DEST` or `RESOLVE_SOURCE`/`RESOLVE_DEST` for the call and back to `COMMON` at Close. An upload buffer stays readable and a readback buffer stays a copy destination. - A call the desktop would reject is counted, logged (first six) and not forwarded, with a named reason (`size_mismatch`, `sample_mismatch`, `range_overflow`, `source_not_multisampled`, ...). Calls on a closed list are ignored. - A typeless resolve format resolves as the family's typed choice (half float for `R16G16B16A16`, as in #1729; normalised for the 8-bit and 10-bit families). One with no single choice (for example `R16_TYPELESS`) is refused as `bad_format`. - `x2w_d3d12_list_copy_stats` exports the counters for fixtures. - `CopyTextureRegion` (16) and `CopyTiles` (18) are left out on purpose. Code is in new files: `src/startup_stubs/list_copy.h` (pure checks) and `list_copy.inl` (handlers). `d3d12_xs_device.cpp` gets one include of each, plus three install lines after the slot 52 line. These slots have not been seen in a title log yet; the placement follows the unshifted slot order. ## Checks run locally (Linux) ``` g++ -std=c++17 -Wall -Wextra -Isrc -I/usr/include/directx -I/usr/include/wsl/stubs -include wsl/winadapter.h tests/startup_list_copy_check.cpp ./a.out # ok; --mutate overflow, typeless, samples each fail x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only -Isrc tests/startup_list_copy.cpp x86_64-w64-mingw32-g++ -std=c++17 -fsyntax-only ... src/startup_stubs/d3d12_xs_device.cpp # only the two __try/__except errors of local_log.h, none from the new code git diff --check python3 -B tests/docs_links_check.py python3 -B tests/bidi_controls_check.py git merge-tree --write-tree HEAD <ref> # origin/main, #1726, #1787, #1788, #1799, #1800, #1803: no conflicts ``` ## Not run `startup_list_copy_{warp,hardware}` and the new device code have not been built or run; they need Windows. The fixture records on one list: clear and copy, a swapped copy (the empty texture stays empty), a 4-sample resolve, a typeless half-float resolve, two buffer copies with offsets, four refused calls (size mismatch, null source, one-sample resolve source, range past the end) and calls on a closed list, then reads everything back and checks the debug layer. AI-assisted; commands listed were executed locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:34:45 +00:00
github-bot closed this pull request 2026-11-26 23:34:45 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 19:14 UTC · original

Closing this draft for now to help keep the open PR queue manageable; the branch stays preserved on the fork so it can be reopened once the queue clears.

**@⁠tedin7** on GitHub · 2026-11-24 19:14 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1811#issuecomment-7141816795) Closing this draft for now to help keep the open PR queue manageable; the branch stays preserved on the fork so it can be reopened once the queue clears.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.