Part of #870 #2852

Closed
opened 2026-11-26 14:41:10 +00:00 by tedin7 · 1 comment
tedin7 commented 2026-11-26 14:41:10 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T14:41:10Z.


What this unblocks: translated compute dispatches whose input buffers were written by the title (placed buffers that do not alias title memory) and dispatches with an unbound input run instead of being refused.

Problem

A translated compute dispatch reads its input buffers from GPU-backed ranges. When an input lies in a placed buffer that does not alias title memory (slot 133 copied_buffer), the desktop copy is a committed default buffer that holds zeros: the bytes the title wrote exist only in title memory. Today the dispatch is refused ("an input is in a placed buffer that does not alias title memory"). A second case is refused too: an input descriptor whose four words are all zero is an unbound (null) buffer, which the hardware reads as zeros, but the dispatch says "an input buffer descriptor has zero records".

Proposal

Runtime only (d3d12_draw.inl, d3d12_compute_dispatch.inl, d3d12_xs_device.cpp):

  • X2W_TRANSLATED_TITLE_INPUT_SNAPSHOT=1 (opt-in): order is a GPU copy this list made, else a snapshot of at most 16 MiB copied from title memory at the dispatch. A later title write is not seen, and data a GPU pass wrote into that buffer is not either (documented in docs/experiments.md).
  • Snapshots use their own 128 MiB upload pool, so draw and texture uploads cannot use up the shared 256 MiB pool and make every later snapshot fail.
  • An all-zero compute input descriptor binds 16 zero bytes. An empty range with any non-zero word stays refused.
  • The log names the source of the first input of each key; the render totals count GPU copies, snapshots and snapshot KiB.

Tests

startup_compute_dispatch_input (WARP and hardware): dispatch-input-snapshot (off: refused; on: all 320 words match; zero title memory runs on zeros), dispatch-input-null (not refused, reads zeros), and the existing dispatch-input-empty control still refused.

Out of scope

Recycling the shared upload pool (separate change), translator pieces.

Source: Microsoft D3D12 documentation (placed resources, upload heaps, raw buffer SRVs).

Real-hardware testing: @Makto94 - thanks for the help.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6629024415 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2860). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T14:41:10Z. --- What this unblocks: translated compute dispatches whose input buffers were written by the title (placed buffers that do not alias title memory) and dispatches with an unbound input run instead of being refused. ## Problem A translated compute dispatch reads its input buffers from GPU-backed ranges. When an input lies in a placed buffer that does not alias title memory (slot 133 `copied_buffer`), the desktop copy is a committed default buffer that holds zeros: the bytes the title wrote exist only in title memory. Today the dispatch is refused ("an input is in a placed buffer that does not alias title memory"). A second case is refused too: an input descriptor whose four words are all zero is an unbound (null) buffer, which the hardware reads as zeros, but the dispatch says "an input buffer descriptor has zero records". ## Proposal Runtime only (`d3d12_draw.inl`, `d3d12_compute_dispatch.inl`, `d3d12_xs_device.cpp`): - `X2W_TRANSLATED_TITLE_INPUT_SNAPSHOT=1` (opt-in): order is a GPU copy this list made, else a snapshot of at most 16 MiB copied from title memory at the dispatch. A later title write is not seen, and data a GPU pass wrote into that buffer is not either (documented in `docs/experiments.md`). - Snapshots use their own 128 MiB upload pool, so draw and texture uploads cannot use up the shared 256 MiB pool and make every later snapshot fail. - An all-zero compute input descriptor binds 16 zero bytes. An empty range with any non-zero word stays refused. - The log names the source of the first input of each key; the render totals count GPU copies, snapshots and snapshot KiB. ## Tests `startup_compute_dispatch_input` (WARP and hardware): `dispatch-input-snapshot` (off: refused; on: all 320 words match; zero title memory runs on zeros), `dispatch-input-null` (not refused, reads zeros), and the existing `dispatch-input-empty` control still refused. ## Out of scope Recycling the shared upload pool (separate change), translator pieces. Source: Microsoft D3D12 documentation (placed resources, upload heaps, raw buffer SRVs). Real-hardware testing: @Makto94 - thanks for the help.
tedin7 commented 2026-11-26 15:01:00 +00:00 (Migrated from github.com)
Author
Contributor

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


Claiming this; a Draft PR follows shortly.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7195175217 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2860#issuecomment-7195175217). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T14:41:11Z. --- Claiming this; a Draft PR follows shortly.
Sign in to join this conversation.
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#2852
No description provided.