translated draws: a failed upload-ring copy of a readable buffer binds null silently; count it (ring_full) and report ring statistics #2855

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

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


Part of #870

Problem

In draw_translated (src/startup_stubs/d3d12_draw.inl) a buffer binding whose guest memory is readable but whose frame copy finds no upload-ring space is bound as a null view. The shader then reads zeros as if the title had bound nothing, and the draw goes on with wrong data. The counters cannot tell this from a descriptor the title really left empty: the null bindings cause split (entry, buffer, token, wrapper, dimension) files it under buffer.

reserve_upload_ring also gives no view of how full the ring is: a refusal is logged only for the first eight calls, so the point where the ring starts to fail cannot be read from the log.

Expected

  • A readable buffer range whose copy failed refuses the draw (no wrong data) and is counted under its own null cause, ring_full.
  • The render totals show the ring: bytes reserved, number of reservations, refusals, capacity.

Proposed change

  • NullCause::ring_full (sixth slot, printed ring_full N at the end of the null-bindings group of the x2w-render totals line) in src/startup_stubs/null_binding_cause.h; BindingFacts::ring_failed.
  • The two copy sites of the buffer binding (the frame copy and the odd-size padded stream) refuse the draw and count ring_full when the range was readable and the copy failed. Unreadable or empty descriptors stay null as before.
  • x2w-render upload ring: reserved N MiB in N reservations, refusals N, capacity N MiB every 300 frames.
  • startup_null_cause_labels_check covers the sixth cause (its --mutate buffer-token control stays).

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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6629040676 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2863). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T14:42:03Z. --- Part of #870 ## Problem In `draw_translated` (`src/startup_stubs/d3d12_draw.inl`) a buffer binding whose guest memory is readable but whose frame copy finds no upload-ring space is bound as a null view. The shader then reads zeros as if the title had bound nothing, and the draw goes on with wrong data. The counters cannot tell this from a descriptor the title really left empty: the `null bindings` cause split (entry, buffer, token, wrapper, dimension) files it under `buffer`. `reserve_upload_ring` also gives no view of how full the ring is: a refusal is logged only for the first eight calls, so the point where the ring starts to fail cannot be read from the log. ## Expected - A readable buffer range whose copy failed refuses the draw (no wrong data) and is counted under its own null cause, `ring_full`. - The render totals show the ring: bytes reserved, number of reservations, refusals, capacity. ## Proposed change - `NullCause::ring_full` (sixth slot, printed `ring_full N` at the end of the null-bindings group of the `x2w-render totals` line) in `src/startup_stubs/null_binding_cause.h`; `BindingFacts::ring_failed`. - The two copy sites of the buffer binding (the frame copy and the odd-size padded stream) refuse the draw and count `ring_full` when the range was readable and the copy failed. Unreadable or empty descriptors stay null as before. - `x2w-render upload ring: reserved N MiB in N reservations, refusals N, capacity N MiB` every 300 frames. - `startup_null_cause_labels_check` covers the sixth cause (its `--mutate buffer-token` control stays). 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:42:05Z.


Claiming this; a Draft PR follows shortly.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7195196144 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2863#issuecomment-7195196144). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-26T14:42:05Z. --- 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#2855
No description provided.