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

Merged
lukaslw-lab merged 1 commit from upstream-pr/1901 into main 2026-11-24 21:04:06 +00:00
lukaslw-lab commented 2026-11-24 20:41:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-24T20:41:14Z.


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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6590993471 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1901). Originally posted by [lukaslw-lab](https://github.com/lukaslw-lab) on 2026-11-24T20:41:14Z. --- _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)
upstream-sync closed this pull request 2026-11-24 21:27:29 +00:00
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!1894
No description provided.