d3d12_xs: support buffer memory SRVs on slot 70 #1449

Merged
tedin7 merged 6 commits from upstream-pr/1456 into main 2026-11-24 12:46:35 +00:00
tedin7 commented 2026-11-24 11:52:00 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:52:00Z.


Summary

Support buffer memory SRVs on device slot 70 (src/startup_stubs/d3d12_memory_srv.inl), with pure validation and offset helpers in src/startup_stubs/memory_srv_buffer.h:

  • Validates buffer resource descriptions and raw (R32_TYPELESS), structured (Format == UNKNOWN, stride a multiple of 4, at most 2048), and typed buffer SRV descriptions, plus element bounds and alignment.
  • Resolves live placed (slot 133) or committed (slot 127) buffers covering [address, address + (FirstElement + NumElements) * element_bytes), adjusts FirstElement by (address - base) / element_bytes, and forwards to view_slot<18, 2>.
  • Acceleration-structure views are not handled by this PR: they are refused and leave the destination descriptor unchanged. They need an actual built structure through the placed AS boundary, which will be a separate change.
  • Preserves #1420's refusal telemetry and all existing texture memory-SRV behavior untouched.
  • Documents the slot 70 buffer path in docs/startup-runtime.md and docs/experiments.md.

Verification

  • Linux local checks: git diff --check, tests/docs_links_check.py, tests/bidi_controls_check.py, pipeline preflight.
  • Windows Server 2025 (Debug & Release /O2 via x2w_pipe.py win2025): see the PR comment.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6581130827 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T11:52:00Z. --- ## Summary Support buffer memory SRVs on device slot 70 (`src/startup_stubs/d3d12_memory_srv.inl`), with pure validation and offset helpers in `src/startup_stubs/memory_srv_buffer.h`: - Validates buffer resource descriptions and raw (`R32_TYPELESS`), structured (`Format == UNKNOWN`, stride a multiple of 4, at most 2048), and typed buffer SRV descriptions, plus element bounds and alignment. - Resolves live placed (slot 133) or committed (slot 127) buffers covering `[address, address + (FirstElement + NumElements) * element_bytes)`, adjusts `FirstElement` by `(address - base) / element_bytes`, and forwards to `view_slot<18, 2>`. - Acceleration-structure views are not handled by this PR: they are refused and leave the destination descriptor unchanged. They need an actual built structure through the placed AS boundary, which will be a separate change. - Preserves `#1420`'s refusal telemetry and all existing texture memory-SRV behavior untouched. - Documents the slot 70 buffer path in `docs/startup-runtime.md` and `docs/experiments.md`. ## Verification - Linux local checks: `git diff --check`, `tests/docs_links_check.py`, `tests/bidi_controls_check.py`, pipeline `preflight`. - Windows Server 2025 (Debug & Release `/O2` via `x2w_pipe.py win2025`): see the PR comment. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-24 12:03:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:58:28Z.


Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 4ec5dae113bdb0ad9efecc29011396973ba3bece:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_shim startup_stream_consumer startup_memory_srv_report_check startup_memory_srv_buffer_check -- -j 6): 4.05s (configure 1.68s)
    • Test (ctest --preset dev -R '^(startup_memory_srv_(report|buffer)|startup_address_(srv|buffer_srv|bc_view)_warp|startup_placed_vertex_warp)$' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (4.20s: startup_memory_srv_buffer 0.01s, startup_memory_srv_report 0.01s, startup_placed_vertex_warp 0.95s, startup_address_buffer_srv_warp 0.96s, startup_address_srv_warp 1.01s, startup_address_bc_view_warp 4.13s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_shim startup_stream_consumer startup_memory_srv_report_check startup_memory_srv_buffer_check -- -j 6): 36.63s (configure 1.71s)
    • Test (ctest --preset release -R '^(startup_memory_srv_(report|buffer)|startup_address_(srv|buffer_srv|bc_view)_warp|startup_placed_vertex_warp)$' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (4.22s: startup_memory_srv_report 0.02s, startup_memory_srv_buffer 0.02s, startup_placed_vertex_warp 1.02s, startup_address_srv_warp 1.07s, startup_address_buffer_srv_warp 1.25s, startup_address_bc_view_warp 4.15s)
  • sccache: 7/11 hits; wall 58.2s
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7130791594 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#issuecomment-7130791594). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T11:58:28Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `4ec5dae113bdb0ad9efecc29011396973ba3bece`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_shim startup_stream_consumer startup_memory_srv_report_check startup_memory_srv_buffer_check -- -j 6`): `4.05s` (configure `1.68s`) - Test (`ctest --preset dev -R '^(startup_memory_srv_(report|buffer)|startup_address_(srv|buffer_srv|bc_view)_warp|startup_placed_vertex_warp)$' --parallel 4 --no-tests=error --output-on-failure`): **6/6 passed** (`4.20s`: `startup_memory_srv_buffer` `0.01s`, `startup_memory_srv_report` `0.01s`, `startup_placed_vertex_warp` `0.95s`, `startup_address_buffer_srv_warp` `0.96s`, `startup_address_srv_warp` `1.01s`, `startup_address_bc_view_warp` `4.13s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_shim startup_stream_consumer startup_memory_srv_report_check startup_memory_srv_buffer_check -- -j 6`): `36.63s` (configure `1.71s`) - Test (`ctest --preset release -R '^(startup_memory_srv_(report|buffer)|startup_address_(srv|buffer_srv|bc_view)_warp|startup_placed_vertex_warp)$' --parallel 4 --no-tests=error --output-on-failure`): **6/6 passed** (`4.22s`: `startup_memory_srv_report` `0.02s`, `startup_memory_srv_buffer` `0.02s`, `startup_placed_vertex_warp` `1.02s`, `startup_address_srv_warp` `1.07s`, `startup_address_buffer_srv_warp` `1.25s`, `startup_address_bc_view_warp` `4.15s`) - `sccache`: 7/11 hits; wall `58.2s`
chatgpt-codex-connector[bot commented 2026-11-24 12:03:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:58:42Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T12:08:08.579751Z 4ec5dae Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7130796404 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#issuecomment-7130796404). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T11:58:42Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"4ec5dae113bdb0ad9efecc29011396973ba3bece","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T12:08:08.579751Z">2026-11-24T12:08:08.579751Z</relative-time> | `4ec5dae` | Draft marked ready | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
upstream-sync changed title from [PR #1456] d3d12_xs: support buffer and RT-AS memory SRVs on slot 70 to [PR #1456] d3d12_xs: support buffer memory SRVs on slot 70 2026-11-24 13:00:33 +00:00
upstream-sync closed this pull request 2026-11-24 13:00:33 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 13:00:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:08:05Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4ec5dae113

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6038910635 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#pullrequestreview-6038910635). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T12:08:05Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `4ec5dae113` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
tedin7 commented 2026-11-24 13:00:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:50Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6039021561 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#pullrequestreview-6039021561). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T12:15:50Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-24 13:00:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:54Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6039022366 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#pullrequestreview-6039022366). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T12:15:54Z. **Review:** COMMENTED --- _No description provided._
tedin7 commented 2026-11-24 13:00:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:58Z.

Review: COMMENTED


No description provided.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6039023240 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#pullrequestreview-6039023240). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T12:15:58Z. **Review:** COMMENTED --- _No description provided._
R0Y00 commented 2026-11-24 13:00:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T12:17:34Z.

Review: CHANGES_REQUESTED


Please split the validated buffer-view path from the acceleration-structure path, or add an independent AS use test. The RT-AS branch verifies an address range and adapter tier but currently accepts an ordinary owned buffer with no AS role/lifecycle check before publishing the descriptor. Reuse the placed AS boundary from the existing DXR fixtures. Test that an actual built AS can be consumed through slot 70 and an aligned ordinary buffer leaves the previous descriptor intact. For structured views also enforce the desktop stride constraints before creating the view.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6039044406 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#pullrequestreview-6039044406). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T12:17:34Z. **Review:** CHANGES_REQUESTED --- Please split the validated buffer-view path from the acceleration-structure path, or add an independent AS use test. The RT-AS branch verifies an address range and adapter tier but currently accepts an ordinary owned buffer with no AS role/lifecycle check before publishing the descriptor. Reuse the placed AS boundary from the existing DXR fixtures. Test that an actual built AS can be consumed through slot 70 and an aligned ordinary buffer leaves the previous descriptor intact. For structured views also enforce the desktop stride constraints before creating the view.
R0Y00 commented 2026-11-24 13:00:34 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T12:46:24Z.

Review: APPROVED


Rebuilt the source-built consumer and shim on adf1d255. Both RTX and WARP verified the placed buffer readbacks and preserved the previous descriptor after refusing the acceleration-structure view. Six Release checks passed, zero skips. Keeping the AS behavior for an independent PR resolves the earlier scope concern.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6039430174 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#pullrequestreview-6039430174). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T12:46:24Z. **Review:** APPROVED --- Rebuilt the source-built consumer and shim on adf1d255. Both RTX and WARP verified the placed buffer readbacks and preserved the previous descriptor after refusing the acceleration-structure view. Six Release checks passed, zero skips. Keeping the AS behavior for an independent PR resolves the earlier scope concern.
ChazY11 commented 2026-11-24 13:00:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T12:19:22Z.


Built and run here; two mutations show the new device-free check is the only guard

Independent reviewer, not the author. Reviewed 4ec5dae1; nothing pushed to the branch. Mutations below were made
locally, rebuilt, reverted; working tree is clean.

Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100, DXC 1.8.2502.11, debug layer enabled;
Intel Arc 140T (32.0.101.8132) for the _hardware variants.

cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -R '^(startup_memory_srv_buffer|startup_address_buffer_srv_.*|startup_stream_draw_.*)$'

Unmodified branch — 5 of 5 pass: startup_memory_srv_buffer 0.17 s, startup_address_buffer_srv_warp 1.59 s,
startup_address_buffer_srv_hardware 2.45 s, startup_stream_draw_warp 5.08 s, startup_stream_draw_hardware
12.55 s. So the new slot-70 path does not disturb the stream draw on this adapter.

Mutation A — element bounds accepted unconditionally

-return v.Buffer.FirstElement <= total_elements &&
-       v.Buffer.NumElements <= total_elements - v.Buffer.FirstElement;
+return true;
startup_memory_srv_buffer ............ ***Failed
startup_address_buffer_srv_warp ....... Passed
startup_address_buffer_srv_hardware ... Passed

Mutation B — offset % elem_bytes alignment check dropped from resolve_buffer_srv_desc

-if (offset >= buffer_width || offset % elem_bytes != 0) return false;
+if (offset >= buffer_width) return false;
startup_memory_srv_buffer ............ ***Failed
startup_stream_draw_warp .............. Passed
startup_address_buffer_srv_warp ....... Passed
startup_stream_draw_hardware .......... Passed
startup_address_buffer_srv_hardware ... Passed

What the second result means

Both mutations are caught, which is what a new check should do. The part worth recording is that the GPU-side
startup_address_buffer_srv_* test passes under both
— it exercises the resolve path with valid addresses, so a
missing rejection only shows up in the device-free check. That is an argument for keeping startup_memory_srv_buffer
in every job rather than next to the GPU ones, and it is cheap to do because it is device-free.

If you want, one sentence in docs/startup-runtime.md saying which check owns the validation and which owns the resolve
path would stop a future reader from assuming the GPU test covers the rejections. I am not touching your branch.

Verdict

Reviewed 4ec5dae1. Build clean, 5 of 5 pass including both new tests on WARP and on a physical Intel adapter, and the
two injected faults are both caught. No objection from me.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7131276101 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#issuecomment-7131276101). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T12:19:22Z. --- ## Built and run here; two mutations show the new device-free check is the only guard Independent reviewer, not the author. Reviewed `4ec5dae1`; nothing pushed to the branch. Mutations below were made locally, rebuilt, reverted; working tree is clean. Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100, DXC 1.8.2502.11, debug layer enabled; Intel Arc 140T (32.0.101.8132) for the `_hardware` variants. ```powershell cmake --preset dev cmake --build --preset dev ctest --preset dev --no-tests=error -R '^(startup_memory_srv_buffer|startup_address_buffer_srv_.*|startup_stream_draw_.*)$' ``` Unmodified branch — 5 of 5 pass: `startup_memory_srv_buffer` 0.17 s, `startup_address_buffer_srv_warp` 1.59 s, `startup_address_buffer_srv_hardware` 2.45 s, `startup_stream_draw_warp` 5.08 s, `startup_stream_draw_hardware` 12.55 s. So the new slot-70 path does not disturb the stream draw on this adapter. ### Mutation A — element bounds accepted unconditionally ```diff -return v.Buffer.FirstElement <= total_elements && - v.Buffer.NumElements <= total_elements - v.Buffer.FirstElement; +return true; ``` ```text startup_memory_srv_buffer ............ ***Failed startup_address_buffer_srv_warp ....... Passed startup_address_buffer_srv_hardware ... Passed ``` ### Mutation B — `offset % elem_bytes` alignment check dropped from `resolve_buffer_srv_desc` ```diff -if (offset >= buffer_width || offset % elem_bytes != 0) return false; +if (offset >= buffer_width) return false; ``` ```text startup_memory_srv_buffer ............ ***Failed startup_stream_draw_warp .............. Passed startup_address_buffer_srv_warp ....... Passed startup_stream_draw_hardware .......... Passed startup_address_buffer_srv_hardware ... Passed ``` ### What the second result means Both mutations are caught, which is what a new check should do. The part worth recording is that **the GPU-side `startup_address_buffer_srv_*` test passes under both** — it exercises the resolve path with valid addresses, so a missing rejection only shows up in the device-free check. That is an argument for keeping `startup_memory_srv_buffer` in every job rather than next to the GPU ones, and it is cheap to do because it is device-free. If you want, one sentence in `docs/startup-runtime.md` saying which check owns the validation and which owns the resolve path would stop a future reader from assuming the GPU test covers the rejections. I am not touching your branch. ### Verdict Reviewed `4ec5dae1`. Build clean, 5 of 5 pass including both new tests on WARP and on a physical Intel adapter, and the two injected faults are both caught. No objection from me.
tedin7 commented 2026-11-24 13:00:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:27:50Z.


@R0Y00 @ChazY11 Fixed in adf1d255 (with 7ed364a1): split the acceleration-structure path out of this PR.

  • #1456 now covers only the buffer-view path. The RT-AS branch, resolve_rt_as_srv_desc and its tests are removed. Slot 70 refuses an acceleration-structure view (unsupported_description) and leaves the previous descriptor intact. Title, body, docs/startup-runtime.md and docs/experiments.md are updated. A proper AS path needs a built structure through the placed AS boundary and will be a separate change.
  • Structured views now require a stride that is a multiple of 4 (and at most 2048) before the view is created. Device-free tests cover strides 4 and 6.
  • startup_address_srv.cpp now issues an AS view between the structured publish and its draw. The draw still samples the structured descriptor, and the refusal line is matched in startup_address_buffer_srv_check.py.
  • Following the mutation review: docs/startup-runtime.md now states that startup_memory_srv_buffer (device-free) owns every rejection and that startup_address_buffer_srv_* only exercises the resolve path with valid addresses.

Windows Server 2025, x2w_pipe.py win2025, Debug and Release /O2, tested head adf1d255: startup_memory_srv_report, startup_memory_srv_buffer, startup_address_srv_warp, startup_address_buffer_srv_warp, startup_address_bc_view_warp and startup_placed_vertex_warp pass in both configurations (6 of 6, 100%).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7131474287 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#issuecomment-7131474287). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T12:27:50Z. --- @R0Y00 @ChazY11 Fixed in adf1d255 (with 7ed364a1): split the acceleration-structure path out of this PR. - `#1456` now covers only the buffer-view path. The RT-AS branch, `resolve_rt_as_srv_desc` and its tests are removed. Slot 70 refuses an acceleration-structure view (`unsupported_description`) and leaves the previous descriptor intact. Title, body, `docs/startup-runtime.md` and `docs/experiments.md` are updated. A proper AS path needs a built structure through the placed AS boundary and will be a separate change. - Structured views now require a stride that is a multiple of 4 (and at most 2048) before the view is created. Device-free tests cover strides 4 and 6. - `startup_address_srv.cpp` now issues an AS view between the structured publish and its draw. The draw still samples the structured descriptor, and the refusal line is matched in `startup_address_buffer_srv_check.py`. - Following the mutation review: `docs/startup-runtime.md` now states that `startup_memory_srv_buffer` (device-free) owns every rejection and that `startup_address_buffer_srv_*` only exercises the resolve path with valid addresses. Windows Server 2025, `x2w_pipe.py win2025`, Debug and Release `/O2`, tested head adf1d255: `startup_memory_srv_report`, `startup_memory_srv_buffer`, `startup_address_srv_warp`, `startup_address_buffer_srv_warp`, `startup_address_bc_view_warp` and `startup_placed_vertex_warp` pass in both configurations (6 of 6, 100%).
chatgpt-codex-connector[bot commented 2026-11-24 13:00:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:08:05Z.

Code review location: src/startup_stubs/d3d12_memory_srv.inl; line 255

@@ -176,6 +213,48 @@ void __stdcall device_memory_srv(Wrapper* self, const D3D12_RESOURCE_DESC* resou
         if (first_calls(refused, 8)) log_refused_memory_srv("unsupported memory SRV arguments", reason, resource, input, destination);
         return;
     }
+    if (resource->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) {
+        if (static_cast<std::uint32_t>(input->view.ViewDimension) == x2w_startup::srv_dimension_rt_acceleration_structure) {
+            D3D12_FEATURE_DATA_D3D12_OPTIONS5 opts5{};
+            if (FAILED(device_of(self)->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &opts5, sizeof(opts5))) ||
+                opts5.RaytracingTier == D3D12_RAYTRACING_TIER_NOT_SUPPORTED) {
+                if (first_calls(refused, 8))
+                    log_refused_memory_srv("raytracing acceleration structure views are not supported on this adapter",
+                                           "raytracing_unsupported", resource, input, destination);
+                return;
+            }
+            Wrapper* buffer = existing_memory_buffer(self, input->address, resource->Width);
+            const ResourceInfo* info = buffer ? resource_info(buffer) : nullptr;
+            auto* desktop_res = buffer ? static_cast<ID3D12Resource*>(buffer->own().real) : nullptr;
+            D3D12_SHADER_RESOURCE_VIEW_DESC adjusted{};
+            if (!buffer || !info || !desktop_res ||
+                !x2w_startup::resolve_rt_as_srv_desc(reinterpret_cast<u64>(buffer->own().title_memory),
+                                                     info->console.Width, desktop_res->GetGPUVirtualAddress(),
+                                                     input->address, resource->Width, input->view, adjusted)) {
+                if (first_calls(refused, 8))
+                    log_refused_memory_srv("unavailable buffer at the supplied address", "buffer_unavailable",
+                                           resource, input, destination);
+                return;
+            }
+            view_slot<18, 2>(self, 0, reinterpret_cast<u64>(&adjusted), destination, 0);
+            return;
+        }
+        const u64 elem_bytes = x2w_startup::buffer_srv_element_bytes(input->view);
+        const u64 span_bytes = (input->view.Buffer.FirstElement + input->view.Buffer.NumElements) * elem_bytes;
+        Wrapper* buffer = existing_memory_buffer(self, input->address, span_bytes);
+        const ResourceInfo* info = buffer ? resource_info(buffer) : nullptr;
+        D3D12_SHADER_RESOURCE_VIEW_DESC adjusted{};
+        if (!buffer || !info ||
+            !x2w_startup::resolve_buffer_srv_desc(reinterpret_cast<u64>(buffer->own().title_memory),
+                                                  info->console.Width, input->address, input->view, adjusted)) {
+            if (first_calls(refused, 8))
+                log_refused_memory_srv("unavailable buffer at the supplied address", "buffer_unavailable",
+                                       resource, input, destination);
+            return;
+        }
+        view_slot<18, 2>(self, reinterpret_cast<u64>(buffer), reinterpret_cast<u64>(&adjusted), destination, 0);

P1 Badge Use typed element sizes in translated buffer bindings

For an R32G32B32A32_FLOAT SRV with address = base + 16, FirstElement = 1, and NumElements = 4, the new resolver correctly publishes FirstElement = 2. However, the translated-draw consumer in src/startup_stubs/d3d12_draw.inl:941-944 treats every zero-structure-stride view as four-byte elements. It therefore binds base + 8 instead of base + 32 and copies 16 bytes instead of 64; indexed loads also receive stride zero. Newly accepted typed views consequently read incorrect data despite passing the helper tests. Update the translated token consumer to derive typed element sizes and strides from the format, or refuse these views until that consumer supports them.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4679749211 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#discussion_r4679749211). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T12:08:05Z. **Code review location:** `src/startup_stubs/d3d12_memory_srv.inl`; line 255 ~~~~diff @@ -176,6 +213,48 @@ void __stdcall device_memory_srv(Wrapper* self, const D3D12_RESOURCE_DESC* resou if (first_calls(refused, 8)) log_refused_memory_srv("unsupported memory SRV arguments", reason, resource, input, destination); return; } + if (resource->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) { + if (static_cast<std::uint32_t>(input->view.ViewDimension) == x2w_startup::srv_dimension_rt_acceleration_structure) { + D3D12_FEATURE_DATA_D3D12_OPTIONS5 opts5{}; + if (FAILED(device_of(self)->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &opts5, sizeof(opts5))) || + opts5.RaytracingTier == D3D12_RAYTRACING_TIER_NOT_SUPPORTED) { + if (first_calls(refused, 8)) + log_refused_memory_srv("raytracing acceleration structure views are not supported on this adapter", + "raytracing_unsupported", resource, input, destination); + return; + } + Wrapper* buffer = existing_memory_buffer(self, input->address, resource->Width); + const ResourceInfo* info = buffer ? resource_info(buffer) : nullptr; + auto* desktop_res = buffer ? static_cast<ID3D12Resource*>(buffer->own().real) : nullptr; + D3D12_SHADER_RESOURCE_VIEW_DESC adjusted{}; + if (!buffer || !info || !desktop_res || + !x2w_startup::resolve_rt_as_srv_desc(reinterpret_cast<u64>(buffer->own().title_memory), + info->console.Width, desktop_res->GetGPUVirtualAddress(), + input->address, resource->Width, input->view, adjusted)) { + if (first_calls(refused, 8)) + log_refused_memory_srv("unavailable buffer at the supplied address", "buffer_unavailable", + resource, input, destination); + return; + } + view_slot<18, 2>(self, 0, reinterpret_cast<u64>(&adjusted), destination, 0); + return; + } + const u64 elem_bytes = x2w_startup::buffer_srv_element_bytes(input->view); + const u64 span_bytes = (input->view.Buffer.FirstElement + input->view.Buffer.NumElements) * elem_bytes; + Wrapper* buffer = existing_memory_buffer(self, input->address, span_bytes); + const ResourceInfo* info = buffer ? resource_info(buffer) : nullptr; + D3D12_SHADER_RESOURCE_VIEW_DESC adjusted{}; + if (!buffer || !info || + !x2w_startup::resolve_buffer_srv_desc(reinterpret_cast<u64>(buffer->own().title_memory), + info->console.Width, input->address, input->view, adjusted)) { + if (first_calls(refused, 8)) + log_refused_memory_srv("unavailable buffer at the supplied address", "buffer_unavailable", + resource, input, destination); + return; + } + view_slot<18, 2>(self, reinterpret_cast<u64>(buffer), reinterpret_cast<u64>(&adjusted), destination, 0); ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Use typed element sizes in translated buffer bindings** For an `R32G32B32A32_FLOAT` SRV with `address = base + 16`, `FirstElement = 1`, and `NumElements = 4`, the new resolver correctly publishes `FirstElement = 2`. However, the translated-draw consumer in `src/startup_stubs/d3d12_draw.inl:941-944` treats every zero-structure-stride view as four-byte elements. It therefore binds `base + 8` instead of `base + 32` and copies 16 bytes instead of 64; indexed loads also receive stride zero. Newly accepted typed views consequently read incorrect data despite passing the helper tests. Update the translated token consumer to derive typed element sizes and strides from the format, or refuse these views until that consumer supports them. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot commented 2026-11-24 13:00:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:08:05Z.

Code review location: docs/startup-runtime.md; line 708

@@ -700,3 +700,26 @@ is not affected: section-backed pages already took the committed, not-aliased pa
 - `ctest --preset release --no-tests=error -R '^xmem_page_runs_device_' -V` places a buffer
   (slot 133) inside one view and across three kinds of boundary: two mapping calls, two backing
   sections, and single-page views.
+
+## Buffer and raytracing acceleration-structure memory SRVs (device slot 70)
+
+Device slot 70 (`src/startup_stubs/d3d12_memory_srv.inl`, validation in
+`src/startup_stubs/memory_srv_buffer.h`) also accepts `D3D12_RESOURCE_DIMENSION_BUFFER`
+descriptions with:

P1 Badge Update the existing slot-70 experiment contract

AGENTS.md requires public capability changes to update the README or docs/experiments.md, but this new section leaves docs/experiments.md:9612-9615 explicitly claiming that buffer and acceleration-structure views are always refused with unsupported_description and implement no semantics. That now contradicts both the implementation and the changed existing SRV test. Update the existing experiment section and its reproduction commands with the supported profile and new refusal reasons rather than leaving conflicting capability descriptions.

AGENTS.md reference: AGENTS.md:L190-L191

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4679749220 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#discussion_r4679749220). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T12:08:05Z. **Code review location:** `docs/startup-runtime.md`; line 708 ~~~~diff @@ -700,3 +700,26 @@ is not affected: section-backed pages already took the committed, not-aliased pa - `ctest --preset release --no-tests=error -R '^xmem_page_runs_device_' -V` places a buffer (slot 133) inside one view and across three kinds of boundary: two mapping calls, two backing sections, and single-page views. + +## Buffer and raytracing acceleration-structure memory SRVs (device slot 70) + +Device slot 70 (`src/startup_stubs/d3d12_memory_srv.inl`, validation in +`src/startup_stubs/memory_srv_buffer.h`) also accepts `D3D12_RESOURCE_DIMENSION_BUFFER` +descriptions with: ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Update the existing slot-70 experiment contract** `AGENTS.md` requires public capability changes to update the README or `docs/experiments.md`, but this new section leaves `docs/experiments.md:9612-9615` explicitly claiming that buffer and acceleration-structure views are always refused with `unsupported_description` and implement no semantics. That now contradicts both the implementation and the changed existing SRV test. Update the existing experiment section and its reproduction commands with the supported profile and new refusal reasons rather than leaving conflicting capability descriptions. AGENTS.md reference: [AGENTS.md:L190-L191](https://github.com/R0Y00/Xbox2Windows/blob/4ec5dae113bdb0ad9efecc29011396973ba3bece/AGENTS.md#L190-L191) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
chatgpt-codex-connector[bot commented 2026-11-24 13:00:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T12:08:05Z.

Code review location: src/startup_stubs/memory_srv_buffer.h; line 38

@@ -0,0 +1,160 @@
+// Pure validation and offset/GPU-address resolution for buffer and raytracing
+// acceleration-structure memory SRVs (device slot 70).
+#pragma once
+
+#include <d3d12.h>
+
+#include <cstdint>
+
+namespace x2w_startup {
+
+constexpr std::uint32_t srv_dimension_rt_acceleration_structure = 11;
+
+// Byte size of a single element for typed buffer SRVs; 0 when unknown or invalid for typed buffers.
+inline std::uint32_t typed_buffer_format_bytes(DXGI_FORMAT format)
+{
+    switch (format) {
+    case DXGI_FORMAT_R32G32B32A32_FLOAT:
+    case DXGI_FORMAT_R32G32B32A32_UINT:
+    case DXGI_FORMAT_R32G32B32A32_SINT:
+        return 16;
+    case DXGI_FORMAT_R32G32B32_FLOAT:
+    case DXGI_FORMAT_R32G32B32_UINT:
+    case DXGI_FORMAT_R32G32B32_SINT:
+        return 12;
+    case DXGI_FORMAT_R16G16B16A16_FLOAT:
+    case DXGI_FORMAT_R16G16B16A16_UNORM:
+    case DXGI_FORMAT_R16G16B16A16_UINT:
+    case DXGI_FORMAT_R16G16B16A16_SNORM:
+    case DXGI_FORMAT_R16G16B16A16_SINT:
+    case DXGI_FORMAT_R32G32_FLOAT:
+    case DXGI_FORMAT_R32G32_UINT:
+    case DXGI_FORMAT_R32G32_SINT:
+        return 8;
+    case DXGI_FORMAT_R10G10B10A2_UNORM:
+    case DXGI_FORMAT_R10G10B10A2_UINT:
+    case DXGI_FORMAT_R11G11B10_FLOAT:
+    case DXGI_FORMAT_R8G8B8A8_UNORM:
+    case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:

P2 Badge Reject formats that cannot be used for typed buffer SRVs

A slot-70 call for a live buffer using DXGI_FORMAT_R8G8B8A8_UNORM_SRGB now passes validation because this whitelist returns four bytes, and view_slot<18, 2> forwards the format unchanged. However, sRGB formats do not support desktop buffer SRVs, so this issues an invalid CreateShaderResourceView call instead of refusing the update and preserving the previous descriptor; invalid view calls can remove the desktop device, as the existing forwarding code documents. Remove unsupported formats from this whitelist or verify D3D12_FORMAT_SUPPORT1_BUFFER and shader-load support before publishing the view.

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4679749229 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#discussion_r4679749229). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T12:08:05Z. **Code review location:** `src/startup_stubs/memory_srv_buffer.h`; line 38 ~~~~diff @@ -0,0 +1,160 @@ +// Pure validation and offset/GPU-address resolution for buffer and raytracing +// acceleration-structure memory SRVs (device slot 70). +#pragma once + +#include <d3d12.h> + +#include <cstdint> + +namespace x2w_startup { + +constexpr std::uint32_t srv_dimension_rt_acceleration_structure = 11; + +// Byte size of a single element for typed buffer SRVs; 0 when unknown or invalid for typed buffers. +inline std::uint32_t typed_buffer_format_bytes(DXGI_FORMAT format) +{ + switch (format) { + case DXGI_FORMAT_R32G32B32A32_FLOAT: + case DXGI_FORMAT_R32G32B32A32_UINT: + case DXGI_FORMAT_R32G32B32A32_SINT: + return 16; + case DXGI_FORMAT_R32G32B32_FLOAT: + case DXGI_FORMAT_R32G32B32_UINT: + case DXGI_FORMAT_R32G32B32_SINT: + return 12; + case DXGI_FORMAT_R16G16B16A16_FLOAT: + case DXGI_FORMAT_R16G16B16A16_UNORM: + case DXGI_FORMAT_R16G16B16A16_UINT: + case DXGI_FORMAT_R16G16B16A16_SNORM: + case DXGI_FORMAT_R16G16B16A16_SINT: + case DXGI_FORMAT_R32G32_FLOAT: + case DXGI_FORMAT_R32G32_UINT: + case DXGI_FORMAT_R32G32_SINT: + return 8; + case DXGI_FORMAT_R10G10B10A2_UNORM: + case DXGI_FORMAT_R10G10B10A2_UINT: + case DXGI_FORMAT_R11G11B10_FLOAT: + case DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: ~~~~ --- **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Reject formats that cannot be used for typed buffer SRVs** A slot-70 call for a live buffer using `DXGI_FORMAT_R8G8B8A8_UNORM_SRGB` now passes validation because this whitelist returns four bytes, and `view_slot<18, 2>` forwards the format unchanged. However, sRGB formats do not support desktop buffer SRVs, so this issues an invalid `CreateShaderResourceView` call instead of refusing the update and preserving the previous descriptor; invalid view calls can remove the desktop device, as the existing forwarding code documents. Remove unsupported formats from this whitelist or verify `D3D12_FORMAT_SUPPORT1_BUFFER` and shader-load support before publishing the view. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
tedin7 commented 2026-11-24 13:00:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:50Z.

Code review location: src/startup_stubs/d3d12_memory_srv.inl; line 255

@@ -176,6 +213,48 @@ void __stdcall device_memory_srv(Wrapper* self, const D3D12_RESOURCE_DESC* resou
         if (first_calls(refused, 8)) log_refused_memory_srv("unsupported memory SRV arguments", reason, resource, input, destination);
         return;
     }
+    if (resource->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) {
+        if (static_cast<std::uint32_t>(input->view.ViewDimension) == x2w_startup::srv_dimension_rt_acceleration_structure) {
+            D3D12_FEATURE_DATA_D3D12_OPTIONS5 opts5{};
+            if (FAILED(device_of(self)->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &opts5, sizeof(opts5))) ||
+                opts5.RaytracingTier == D3D12_RAYTRACING_TIER_NOT_SUPPORTED) {
+                if (first_calls(refused, 8))
+                    log_refused_memory_srv("raytracing acceleration structure views are not supported on this adapter",
+                                           "raytracing_unsupported", resource, input, destination);
+                return;
+            }
+            Wrapper* buffer = existing_memory_buffer(self, input->address, resource->Width);
+            const ResourceInfo* info = buffer ? resource_info(buffer) : nullptr;
+            auto* desktop_res = buffer ? static_cast<ID3D12Resource*>(buffer->own().real) : nullptr;
+            D3D12_SHADER_RESOURCE_VIEW_DESC adjusted{};
+            if (!buffer || !info || !desktop_res ||
+                !x2w_startup::resolve_rt_as_srv_desc(reinterpret_cast<u64>(buffer->own().title_memory),
+                                                     info->console.Width, desktop_res->GetGPUVirtualAddress(),
+                                                     input->address, resource->Width, input->view, adjusted)) {
+                if (first_calls(refused, 8))
+                    log_refused_memory_srv("unavailable buffer at the supplied address", "buffer_unavailable",
+                                           resource, input, destination);
+                return;
+            }
+            view_slot<18, 2>(self, 0, reinterpret_cast<u64>(&adjusted), destination, 0);
+            return;
+        }
+        const u64 elem_bytes = x2w_startup::buffer_srv_element_bytes(input->view);
+        const u64 span_bytes = (input->view.Buffer.FirstElement + input->view.Buffer.NumElements) * elem_bytes;
+        Wrapper* buffer = existing_memory_buffer(self, input->address, span_bytes);
+        const ResourceInfo* info = buffer ? resource_info(buffer) : nullptr;
+        D3D12_SHADER_RESOURCE_VIEW_DESC adjusted{};
+        if (!buffer || !info ||
+            !x2w_startup::resolve_buffer_srv_desc(reinterpret_cast<u64>(buffer->own().title_memory),
+                                                  info->console.Width, input->address, input->view, adjusted)) {
+            if (first_calls(refused, 8))
+                log_refused_memory_srv("unavailable buffer at the supplied address", "buffer_unavailable",
+                                       resource, input, destination);
+            return;
+        }
+        view_slot<18, 2>(self, reinterpret_cast<u64>(buffer), reinterpret_cast<u64>(&adjusted), destination, 0);

Fixed in 7d019d80: the translated draw consumer now derives typed element size and stride from the format (16 bytes for R32G32B32A32_FLOAT), with tests.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4679839689 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#discussion_r4679839689). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T12:15:50Z. **Code review location:** `src/startup_stubs/d3d12_memory_srv.inl`; line 255 ~~~~diff @@ -176,6 +213,48 @@ void __stdcall device_memory_srv(Wrapper* self, const D3D12_RESOURCE_DESC* resou if (first_calls(refused, 8)) log_refused_memory_srv("unsupported memory SRV arguments", reason, resource, input, destination); return; } + if (resource->Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) { + if (static_cast<std::uint32_t>(input->view.ViewDimension) == x2w_startup::srv_dimension_rt_acceleration_structure) { + D3D12_FEATURE_DATA_D3D12_OPTIONS5 opts5{}; + if (FAILED(device_of(self)->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &opts5, sizeof(opts5))) || + opts5.RaytracingTier == D3D12_RAYTRACING_TIER_NOT_SUPPORTED) { + if (first_calls(refused, 8)) + log_refused_memory_srv("raytracing acceleration structure views are not supported on this adapter", + "raytracing_unsupported", resource, input, destination); + return; + } + Wrapper* buffer = existing_memory_buffer(self, input->address, resource->Width); + const ResourceInfo* info = buffer ? resource_info(buffer) : nullptr; + auto* desktop_res = buffer ? static_cast<ID3D12Resource*>(buffer->own().real) : nullptr; + D3D12_SHADER_RESOURCE_VIEW_DESC adjusted{}; + if (!buffer || !info || !desktop_res || + !x2w_startup::resolve_rt_as_srv_desc(reinterpret_cast<u64>(buffer->own().title_memory), + info->console.Width, desktop_res->GetGPUVirtualAddress(), + input->address, resource->Width, input->view, adjusted)) { + if (first_calls(refused, 8)) + log_refused_memory_srv("unavailable buffer at the supplied address", "buffer_unavailable", + resource, input, destination); + return; + } + view_slot<18, 2>(self, 0, reinterpret_cast<u64>(&adjusted), destination, 0); + return; + } + const u64 elem_bytes = x2w_startup::buffer_srv_element_bytes(input->view); + const u64 span_bytes = (input->view.Buffer.FirstElement + input->view.Buffer.NumElements) * elem_bytes; + Wrapper* buffer = existing_memory_buffer(self, input->address, span_bytes); + const ResourceInfo* info = buffer ? resource_info(buffer) : nullptr; + D3D12_SHADER_RESOURCE_VIEW_DESC adjusted{}; + if (!buffer || !info || + !x2w_startup::resolve_buffer_srv_desc(reinterpret_cast<u64>(buffer->own().title_memory), + info->console.Width, input->address, input->view, adjusted)) { + if (first_calls(refused, 8)) + log_refused_memory_srv("unavailable buffer at the supplied address", "buffer_unavailable", + resource, input, destination); + return; + } + view_slot<18, 2>(self, reinterpret_cast<u64>(buffer), reinterpret_cast<u64>(&adjusted), destination, 0); ~~~~ --- Fixed in 7d019d80: the translated draw consumer now derives typed element size and stride from the format (16 bytes for R32G32B32A32_FLOAT), with tests.
tedin7 commented 2026-11-24 13:00:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:54Z.

Code review location: docs/startup-runtime.md; line 708

@@ -700,3 +700,26 @@ is not affected: section-backed pages already took the committed, not-aliased pa
 - `ctest --preset release --no-tests=error -R '^xmem_page_runs_device_' -V` places a buffer
   (slot 133) inside one view and across three kinds of boundary: two mapping calls, two backing
   sections, and single-page views.
+
+## Buffer and raytracing acceleration-structure memory SRVs (device slot 70)
+
+Device slot 70 (`src/startup_stubs/d3d12_memory_srv.inl`, validation in
+`src/startup_stubs/memory_srv_buffer.h`) also accepts `D3D12_RESOURCE_DIMENSION_BUFFER`
+descriptions with:

Fixed in 7d019d80: the slot-70 section in docs/experiments.md now describes the supported buffer and acceleration-structure profile and the refusal reasons; docs/startup-runtime.md matches.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4679840294 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#discussion_r4679840294). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T12:15:54Z. **Code review location:** `docs/startup-runtime.md`; line 708 ~~~~diff @@ -700,3 +700,26 @@ is not affected: section-backed pages already took the committed, not-aliased pa - `ctest --preset release --no-tests=error -R '^xmem_page_runs_device_' -V` places a buffer (slot 133) inside one view and across three kinds of boundary: two mapping calls, two backing sections, and single-page views. + +## Buffer and raytracing acceleration-structure memory SRVs (device slot 70) + +Device slot 70 (`src/startup_stubs/d3d12_memory_srv.inl`, validation in +`src/startup_stubs/memory_srv_buffer.h`) also accepts `D3D12_RESOURCE_DIMENSION_BUFFER` +descriptions with: ~~~~ --- Fixed in 7d019d80: the slot-70 section in docs/experiments.md now describes the supported buffer and acceleration-structure profile and the refusal reasons; docs/startup-runtime.md matches.
tedin7 commented 2026-11-24 13:00:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T12:15:58Z.

Code review location: src/startup_stubs/memory_srv_buffer.h; line 38

@@ -0,0 +1,160 @@
+// Pure validation and offset/GPU-address resolution for buffer and raytracing
+// acceleration-structure memory SRVs (device slot 70).
+#pragma once
+
+#include <d3d12.h>
+
+#include <cstdint>
+
+namespace x2w_startup {
+
+constexpr std::uint32_t srv_dimension_rt_acceleration_structure = 11;
+
+// Byte size of a single element for typed buffer SRVs; 0 when unknown or invalid for typed buffers.
+inline std::uint32_t typed_buffer_format_bytes(DXGI_FORMAT format)
+{
+    switch (format) {
+    case DXGI_FORMAT_R32G32B32A32_FLOAT:
+    case DXGI_FORMAT_R32G32B32A32_UINT:
+    case DXGI_FORMAT_R32G32B32A32_SINT:
+        return 16;
+    case DXGI_FORMAT_R32G32B32_FLOAT:
+    case DXGI_FORMAT_R32G32B32_UINT:
+    case DXGI_FORMAT_R32G32B32_SINT:
+        return 12;
+    case DXGI_FORMAT_R16G16B16A16_FLOAT:
+    case DXGI_FORMAT_R16G16B16A16_UNORM:
+    case DXGI_FORMAT_R16G16B16A16_UINT:
+    case DXGI_FORMAT_R16G16B16A16_SNORM:
+    case DXGI_FORMAT_R16G16B16A16_SINT:
+    case DXGI_FORMAT_R32G32_FLOAT:
+    case DXGI_FORMAT_R32G32_UINT:
+    case DXGI_FORMAT_R32G32_SINT:
+        return 8;
+    case DXGI_FORMAT_R10G10B10A2_UNORM:
+    case DXGI_FORMAT_R10G10B10A2_UINT:
+    case DXGI_FORMAT_R11G11B10_FLOAT:
+    case DXGI_FORMAT_R8G8B8A8_UNORM:
+    case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:

Fixed in 7d019d80: sRGB, BGRA and other formats that cannot back a typed buffer SRV are removed from the whitelist and refused, with regression tests for sRGB, BC, depth and typeless.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review-comment:4679840986 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1456#discussion_r4679840986). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T12:15:58Z. **Code review location:** `src/startup_stubs/memory_srv_buffer.h`; line 38 ~~~~diff @@ -0,0 +1,160 @@ +// Pure validation and offset/GPU-address resolution for buffer and raytracing +// acceleration-structure memory SRVs (device slot 70). +#pragma once + +#include <d3d12.h> + +#include <cstdint> + +namespace x2w_startup { + +constexpr std::uint32_t srv_dimension_rt_acceleration_structure = 11; + +// Byte size of a single element for typed buffer SRVs; 0 when unknown or invalid for typed buffers. +inline std::uint32_t typed_buffer_format_bytes(DXGI_FORMAT format) +{ + switch (format) { + case DXGI_FORMAT_R32G32B32A32_FLOAT: + case DXGI_FORMAT_R32G32B32A32_UINT: + case DXGI_FORMAT_R32G32B32A32_SINT: + return 16; + case DXGI_FORMAT_R32G32B32_FLOAT: + case DXGI_FORMAT_R32G32B32_UINT: + case DXGI_FORMAT_R32G32B32_SINT: + return 12; + case DXGI_FORMAT_R16G16B16A16_FLOAT: + case DXGI_FORMAT_R16G16B16A16_UNORM: + case DXGI_FORMAT_R16G16B16A16_UINT: + case DXGI_FORMAT_R16G16B16A16_SNORM: + case DXGI_FORMAT_R16G16B16A16_SINT: + case DXGI_FORMAT_R32G32_FLOAT: + case DXGI_FORMAT_R32G32_UINT: + case DXGI_FORMAT_R32G32_SINT: + return 8; + case DXGI_FORMAT_R10G10B10A2_UNORM: + case DXGI_FORMAT_R10G10B10A2_UINT: + case DXGI_FORMAT_R11G11B10_FLOAT: + case DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: ~~~~ --- Fixed in 7d019d80: sRGB, BGRA and other formats that cannot back a typed buffer SRV are removed from the whitelist and refused, with regression tests for sRGB, BC, depth and typeless.
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!1449
No description provided.