startup: create committed upload and readback resources in their required initial states #1901

Manually merged
github merged 1 commit from gh-pr/1901/head into gh-pr/1901/base 2026-11-26 23:41:21 +00:00
Owner

@⁠lukaslw-lab on GitHub · 2026-11-24 20:41 UTC · original
lukaslw-lab:startup/committed-heap-initial-state → main · +133 −5 · 3 files · 1 commits · merged 2026-11-24 21:04 UTC

AI-assisted (Claude Code).

Change

Device slot 127 (device_create_committed_x) now passes GENERIC_READ for an upload heap and COPY_DEST for a readback heap; other heaps keep COMMON. The Windows 10 runtime refuses COMMON there with E_INVALIDARG. Fixes #1900. Refs #870.

Verification

main at 4c5afa8e + this branch, Windows 10 22H2 (19045), RTX 3080 Ti driver 32.0.16.1047, WARP in-box, debug layer off.

ctest --preset dev --no-tests=error -R '^startup_committed_heap_state_' -V
Test Without the fix With the fix
startup_committed_heap_state_warp fail: upload x2, readback 0x80070057 pass
startup_committed_heap_state_hardware fail: same pass
startup_committed_heap_state_upload_texture_control (WILL_FAIL) (not run) fails as expected: upload-heap 2D texture refused

Affected areas, dev and release (full build of each preset):

ctest --preset dev --no-tests=error -R '^(startup_committed_heap_state_|startup_plane_size_device_|d3d12_xs_shim_|startup_stubs$|startup_null_views|startup_root_heap)'

15/15 passed in each preset, 0 failed. Of those, 2 are capability skips (77): startup_root_heap_warp and _hardware, because the Windows 10 runtime rejects the heap-indexing root flags (#1277); not related to this change.

Evidence and follow-up

  • New fixture tests/startup_committed_heap_state_check.cpp, source-built: default, upload (150 x 768 and 320 x 768 bytes, sizes seen in a startup run) and readback buffers through slot 127, as a title passes them. It prints what the runtime does with COMMON on an upload buffer: refused on Windows 10; a newer runtime that accepts it still passes.
  • "Without the fix" is the same fixture built against main's d3d12_xs_device.cpp (the change reverted locally): it fails on Windows 10 only, because newer runtimes accept COMMON.
  • The registered control therefore does not depend on the runtime: it asks for a 2D texture on an upload heap, which no runtime creates, so the check is shown to fail on a refusal everywhere, including CI.
  • Startup observation (sanitized) in #1900: with this change the Windows 10 post-confirm load no longer stops on the refused buffers.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (No capability change.)
  • I did not include game files, dumps, distribution links or secrets.

🤖 Generated with Claude Code

**@⁠lukaslw-lab** on GitHub · 2026-11-24 20:41 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1901) `lukaslw-lab:startup/committed-heap-initial-state` → `main` · +133 −5 · 3 files · 1 commits · merged 2026-11-24 21:04 UTC _AI-assisted (Claude Code)._ ## Change Device slot 127 (`device_create_committed_x`) now passes `GENERIC_READ` for an upload heap and `COPY_DEST` for a readback heap; other heaps keep `COMMON`. The Windows 10 runtime refuses `COMMON` there with `E_INVALIDARG`. Fixes #1900. Refs #870. ## Verification `main` at `4c5afa8e` + this branch, Windows 10 22H2 (19045), RTX 3080 Ti driver 32.0.16.1047, WARP in-box, debug layer off. ```powershell ctest --preset dev --no-tests=error -R '^startup_committed_heap_state_' -V ``` | Test | Without the fix | With the fix | |---|---|---| | `startup_committed_heap_state_warp` | fail: upload x2, readback `0x80070057` | pass | | `startup_committed_heap_state_hardware` | fail: same | pass | | `startup_committed_heap_state_upload_texture_control` (WILL_FAIL) | (not run) | fails as expected: upload-heap 2D texture refused | Affected areas, `dev` and `release` (full build of each preset): ```powershell ctest --preset dev --no-tests=error -R '^(startup_committed_heap_state_|startup_plane_size_device_|d3d12_xs_shim_|startup_stubs$|startup_null_views|startup_root_heap)' ``` 15/15 passed in each preset, 0 failed. Of those, 2 are capability skips (77): `startup_root_heap_warp` and `_hardware`, because the Windows 10 runtime rejects the heap-indexing root flags (#1277); not related to this change. ## Evidence and follow-up - New fixture `tests/startup_committed_heap_state_check.cpp`, source-built: default, upload (150 x 768 and 320 x 768 bytes, sizes seen in a startup run) and readback buffers through slot 127, as a title passes them. It prints what the runtime does with `COMMON` on an upload buffer: refused on Windows 10; a newer runtime that accepts it still passes. - "Without the fix" is the same fixture built against `main`'s `d3d12_xs_device.cpp` (the change reverted locally): it fails on Windows 10 only, because newer runtimes accept `COMMON`. - The registered control therefore does not depend on the runtime: it asks for a 2D texture on an upload heap, which no runtime creates, so the check is shown to fail on a refusal everywhere, including CI. - Startup observation (sanitized) in #1900: with this change the Windows 10 post-confirm load no longer stops on the refused buffers. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [ ] I updated README/docs when a capability or build requirement changed. (No capability change.) - [x] I did not include game files, dumps, distribution links or secrets. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Device slot 127 created every resource in COMMON. D3D12 requires upload-heap
resources to start in GENERIC_READ and readback-heap resources in COPY_DEST;
the Windows 10 runtime refuses COMMON there with E_INVALIDARG. Other heaps keep
COMMON.

startup_committed_heap_state_{warp,hardware} create default, upload and
readback buffers through slot 127; the upload-texture control asks for a 2D
texture on an upload heap, which no runtime creates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:41:19 +00:00
github manually merged commit 3556bc28c0 into gh-pr/1901/base 2026-11-26 23:41:21 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.