runtime: create committed resources through device slot 76 #2640

Merged
pigalot merged 2 commits from upstream-pr/2648 into main 2026-11-26 00:46:22 +00:00
pigalot commented 2026-11-26 00:26:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-26T00:26:28Z.


Change

Slice 2 of 4 from #2591.

Device slot 76 (Xbox order, +0x260) takes the seven arguments of desktop CreateCommittedResource:
heap properties, heap flags, desc, initial state, clear value, riid and ppv. On main the wrapper has
no entry for it, so a call traps (x2w-trap d3d12_xs.dll!Device::slot76). A console package module (an
upscaler, reached on the Series S profile) creates its resources through this slot.

Slot 76 now shares the committed-resource path of slot 127. The body of device_create_committed_x
becomes create_committed(slot, ...). Slot 127 calls it as before, with protected session and castable
formats. Slot 76 calls it with no session and no castable formats. The only change slot 127 sees is
that its log line names the slot. Slot 76 gets the same per-heap initial-state choice, clear-value
retry and title memory as slot 127.

Refs #2591. Independent of the other three slices.

Verification

Build: this branch, one commit 01d03af5 on main at 02368737. From the worktree in PowerShell:
. .\tools\dev.ps1, cmake --preset release, cmake --build --preset release (Python env
out/pe-env from requirements-dev.txt).

Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088, Windows 10.0.26200.9974, with the debug
layer off.

  • ctest --preset release --no-tests=error -R '^startup_committed_(slot76_(warp|hardware|control)|heap_state_(warp|upload_texture_control))$' -V:
    5/5 passed. These are startup_committed_slot76_warp, _hardware (RTX 5090) and _control, plus
    the existing slot-127 startup_committed_heap_state_warp and
    startup_committed_heap_state_upload_texture_control.
  • ctest --preset release -j 6 --no-tests=error -R '^startup_' -E '_hardware$|^startup_audio_': 640 tests, 634 passed, 6 skipped (capability, exit 77), 0 failed.
  • python -B tests/docs_links_check.py: pass (19 Markdown files, 507 links).
    python -B tests/bidi_controls_check.py: pass. git diff --check origin/main...HEAD: clean.

Evidence

New fixture tests/startup_committed_slot76_check.cpp, written in source (MIT). It calls the
wrapper's slot 76 as a title does, with initial state 0xffffffff, for four resources: a 128x64 RGBA8
render target with a clear value, a default-heap buffer, an upload-heap buffer and a 768-byte readback
buffer. Each must be created, and the device must not be removed.

default heap, 2D texture of 0x80 with clear value: slot 76 -> 0x00000000
default heap, buffer of 0x10000: slot 76 -> 0x00000000
upload heap, buffer of 0x10000: slot 76 -> 0x00000000
readback heap, buffer of 0x300: slot 76 -> 0x00000000
startup_committed_slot76: PASS (render target, default, upload and readback resources created through slot 76)

--control asks for a 2D texture on an upload heap, which no runtime creates. That row prints
FAIL: upload heap 2D texture: hr 0x80070057 ..., and the test is registered with
PASS_REGULAR_EXPRESSION "FAIL: ".

Before/after check: I ran the same fixture binary against a d3d12_xs.dll built from main without
this change (WARP). It stopped at the first call with
x2w-trap d3d12_xs.dll!Device::slot76 ... (exit 127).

The argument order comes from the calls the module makes and from the desktop signature. Slot 76 never
passes a protected session or castable formats.

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.
  • I did not include game files, dumps, distribution links or secrets.

This change was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6616647475 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2648). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-26T00:26:28Z. --- ## Change Slice 2 of 4 from #2591. Device slot 76 (Xbox order, +0x260) takes the seven arguments of desktop `CreateCommittedResource`: heap properties, heap flags, desc, initial state, clear value, riid and ppv. On `main` the wrapper has no entry for it, so a call traps (`x2w-trap d3d12_xs.dll!Device::slot76`). A console package module (an upscaler, reached on the Series S profile) creates its resources through this slot. Slot 76 now shares the committed-resource path of slot 127. The body of `device_create_committed_x` becomes `create_committed(slot, ...)`. Slot 127 calls it as before, with protected session and castable formats. Slot 76 calls it with no session and no castable formats. The only change slot 127 sees is that its log line names the slot. Slot 76 gets the same per-heap initial-state choice, clear-value retry and title memory as slot 127. Refs #2591. Independent of the other three slices. ## Verification Build: this branch, one commit `01d03af5` on `main` at `02368737`. From the worktree in PowerShell: `. .\tools\dev.ps1`, `cmake --preset release`, `cmake --build --preset release` (Python env `out/pe-env` from `requirements-dev.txt`). Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088, Windows 10.0.26200.9974, with the debug layer off. - `ctest --preset release --no-tests=error -R '^startup_committed_(slot76_(warp|hardware|control)|heap_state_(warp|upload_texture_control))$' -V`: 5/5 passed. These are `startup_committed_slot76_warp`, `_hardware` (RTX 5090) and `_control`, plus the existing slot-127 `startup_committed_heap_state_warp` and `startup_committed_heap_state_upload_texture_control`. - `ctest --preset release -j 6 --no-tests=error -R '^startup_' -E '_hardware$|^startup_audio_'`: 640 tests, 634 passed, 6 skipped (capability, exit 77), 0 failed. - `python -B tests/docs_links_check.py`: pass (19 Markdown files, 507 links). `python -B tests/bidi_controls_check.py`: pass. `git diff --check origin/main...HEAD`: clean. ## Evidence New fixture `tests/startup_committed_slot76_check.cpp`, written in source (MIT). It calls the wrapper's slot 76 as a title does, with initial state 0xffffffff, for four resources: a 128x64 RGBA8 render target with a clear value, a default-heap buffer, an upload-heap buffer and a 768-byte readback buffer. Each must be created, and the device must not be removed. ```text default heap, 2D texture of 0x80 with clear value: slot 76 -> 0x00000000 default heap, buffer of 0x10000: slot 76 -> 0x00000000 upload heap, buffer of 0x10000: slot 76 -> 0x00000000 readback heap, buffer of 0x300: slot 76 -> 0x00000000 startup_committed_slot76: PASS (render target, default, upload and readback resources created through slot 76) ``` `--control` asks for a 2D texture on an upload heap, which no runtime creates. That row prints `FAIL: upload heap 2D texture: hr 0x80070057 ...`, and the test is registered with `PASS_REGULAR_EXPRESSION "FAIL: "`. Before/after check: I ran the same fixture binary against a `d3d12_xs.dll` built from `main` without this change (WARP). It stopped at the first call with `x2w-trap d3d12_xs.dll!Device::slot76 ...` (exit 127). The argument order comes from the calls the module makes and from the desktop signature. Slot 76 never passes a protected session or castable formats. ## 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. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. This change was AI-assisted.
upstream-sync closed this pull request 2026-11-26 01:02:03 +00:00
tedin7 commented 2026-11-26 01:02:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T00:32:11Z.

Review: COMMENTED


Comment review of head 01d03af5 (code and fixture tests only).

What I checked:

  • d3d12_xs_device.cpp: the old slot-127 body becomes create_committed(slot, ...). Slot 127 passes 127 and its original session/castable arguments, so its behaviour is unchanged except the log line now names the slot. Slot 76 device_create_committed takes the seven desktop arguments (props, heap flags, desc, state, clear, riid, ppv) and forwards session=nullptr, castable=0/nullptr. The argument order matches the desktop CreateCommittedResource signature in the PR body.
  • The table entry tables[device_kind][76] is the only new registration; slot 76 had no entry before, so no existing behaviour is replaced.
  • Sibling check: slot 127 and slot 76 now share the per-heap initial-state choice, the clear-value retry and the title memory, so they cannot drift apart.
  • No other open or merged PR covers slot 76 (search "slot 76 CreateCommittedResource": only this PR).

Commands run (Linux, in a worktree of this head):

  • git diff --check origin/main...HEAD: clean.
  • python3 tests/docs_links_check.py: passed (19 files, 507 links).
  • python3 tests/bidi_controls_check.py: passed.
  • The new fixture tests/startup_committed_slot76_check.cpp and the WARP/hardware slot-76 tests need the Windows D3D12 build; I did not run them here, so I have no mutation result for them.

Findings: no bugs found in the code. The branch is 20 commits behind main.

Why this is not merged by me: the PR exists because a console package module trapped on slot 76 while running the executable ("x2w-trap ... Device::slot76"). That is a blocker seen while running the game. We have no access to it, so only code and fixture review is possible from our side. Whether the module now gets past this slot must be confirmed by the merger on the executable. The merge stays with MasterDomino or @R0Y00.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6066936329 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2648#pullrequestreview-6066936329). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T00:32:11Z. **Review:** COMMENTED --- Comment review of head 01d03af5 (code and fixture tests only). What I checked: - `d3d12_xs_device.cpp`: the old slot-127 body becomes `create_committed(slot, ...)`. Slot 127 passes `127` and its original session/castable arguments, so its behaviour is unchanged except the log line now names the slot. Slot 76 `device_create_committed` takes the seven desktop arguments (props, heap flags, desc, state, clear, riid, ppv) and forwards `session=nullptr`, `castable=0/nullptr`. The argument order matches the desktop `CreateCommittedResource` signature in the PR body. - The table entry `tables[device_kind][76]` is the only new registration; slot 76 had no entry before, so no existing behaviour is replaced. - Sibling check: slot 127 and slot 76 now share the per-heap initial-state choice, the clear-value retry and the title memory, so they cannot drift apart. - No other open or merged PR covers slot 76 (search "slot 76 CreateCommittedResource": only this PR). Commands run (Linux, in a worktree of this head): - `git diff --check origin/main...HEAD`: clean. - `python3 tests/docs_links_check.py`: passed (19 files, 507 links). - `python3 tests/bidi_controls_check.py`: passed. - The new fixture `tests/startup_committed_slot76_check.cpp` and the WARP/hardware slot-76 tests need the Windows D3D12 build; I did not run them here, so I have no mutation result for them. Findings: no bugs found in the code. The branch is 20 commits behind main. Why this is not merged by me: the PR exists because a console package module trapped on slot 76 while running the executable ("x2w-trap ... Device::slot76"). That is a blocker seen while running the game. We have no access to it, so only code and fixture review is possible from our side. Whether the module now gets past this slot must be confirmed by the merger on the executable. The merge stays with MasterDomino or @R0Y00. AI-assisted; commands listed were executed locally.
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!2640
No description provided.