startup: publish acceleration-structure views on device slot 70 #1793

Closed
tedin7 wants to merge 2 commits from upstream-pr/1800 into main
tedin7 commented 2026-11-24 18:51:17 +00:00 (Migrated from github.com)

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


Related to #870 and #1758 (no Fixes).

What changes

Device slot 70 now publishes a D3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURE view instead of refusing it as unsupported_description.

  • New pure header src/startup_stubs/memory_srv_as.h. The address is the view's Location, or the call's address when Location is zero. The resource description is not read for these views.
  • The view is published through slot 18 with no resource and the desktop GPU address of the same byte when:
    • the address is 256-byte aligned (as_unaligned);
    • it starts inside one live placed (slot 133) buffer (as_not_placed), found with placed_buffer_range unchanged;
    • that buffer was created in D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE (as_wrong_state).
  • Any refusal leaves the destination descriptor unchanged and logs the reason (first eight per process, as before).
  • The report note on a dimension-11 view now reads (acceleration structure view). startup_address_buffer_srv_check.py expects as_wrong_state for its placed COMMON buffer.
  • placed_build.h and resolve_placed_build are untouched.

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_memory_srv_as_check.cpp
./a.out   # ok; --mutate alignment, state, offset each fail
g++ ... tests/startup_memory_srv_report_check.cpp && ./a.out   # ok
x86_64-w64-mingw32-g++ -std=c++17 -Isrc -fsyntax-only tests/startup_memory_srv_as_check.cpp
git diff --check
python3 -B tests/docs_links_check.py
python3 -B tests/bidi_controls_check.py
git merge-tree --write-tree HEAD origin/main   # and #1766, #1787, #1788, #1789: no conflicts

Not run

The slot 70 hook in d3d12_memory_srv.inl and the updated startup_address_srv / startup_address_buffer_srv expectations need a Windows build and WARP run. They have not been compiled or executed. No device publishes a real AS view yet: the pure resolver is tested, the device path is not.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6589053625 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1800). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T18:51:17Z. --- Related to #870 and #1758 (no `Fixes`). ## What changes Device slot 70 now publishes a `D3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURE` view instead of refusing it as `unsupported_description`. - New pure header `src/startup_stubs/memory_srv_as.h`. The address is the view's `Location`, or the call's address when `Location` is zero. The resource description is not read for these views. - The view is published through slot 18 with no resource and the desktop GPU address of the same byte when: - the address is 256-byte aligned (`as_unaligned`); - it starts inside one live placed (slot 133) buffer (`as_not_placed`), found with `placed_buffer_range` unchanged; - that buffer was created in `D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE` (`as_wrong_state`). - Any refusal leaves the destination descriptor unchanged and logs the reason (first eight per process, as before). - The report note on a dimension-11 view now reads `(acceleration structure view)`. `startup_address_buffer_srv_check.py` expects `as_wrong_state` for its placed COMMON buffer. - `placed_build.h` and `resolve_placed_build` are untouched. ## 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_memory_srv_as_check.cpp ./a.out # ok; --mutate alignment, state, offset each fail g++ ... tests/startup_memory_srv_report_check.cpp && ./a.out # ok x86_64-w64-mingw32-g++ -std=c++17 -Isrc -fsyntax-only tests/startup_memory_srv_as_check.cpp git diff --check python3 -B tests/docs_links_check.py python3 -B tests/bidi_controls_check.py git merge-tree --write-tree HEAD origin/main # and #1766, #1787, #1788, #1789: no conflicts ``` ## Not run The slot 70 hook in `d3d12_memory_srv.inl` and the updated `startup_address_srv` / `startup_address_buffer_srv` expectations need a Windows build and WARP run. They have not been compiled or executed. No device publishes a real AS view yet: the pure resolver is tested, the device path is not. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-24 20:00:39 +00:00
tedin7 commented 2026-11-24 20:01:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:14:37Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7141811521 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1800#issuecomment-7141811521). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:14:37Z. --- 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

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!1793
No description provided.