GPU: two invalid calls the title made, and the diagnostics feature #2429

Closed
FoxxoOwO wants to merge 2 commits from upstream-pr/2431 into main
FoxxoOwO commented 2026-11-25 13:25:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by FoxxoOwO on 2026-11-25T13:25:22Z.


The D3D12 debug layer (previously unusable — the app's diagnostics feature did not forward to victory-gpu, so VICTORY_D3D12_DEBUG and VICTORY_D3D12_WARP could never turn on) names two calls that remove the device while the title loads its world.

Both are gone:

  • crates/victory-gpu/src/resource.rs in shared_texture: GetResourceAllocationInfo was asked about the title's texture description, which may carry ALLOW_UNORDERED_ACCESS in a format the host cannot view as unordered access — an invalid call, answered by device removal. It now asks the live host texture's own description. The result is only the SAVED statistic of shared bytes.
  • crates/victory-gpu/src/descriptor/host.rs in fits: a texture unordered view took the title's view format unconditionally. CreateUnorderedAccessView with B5G5R5A1_UNORM (the menu's) is an invalid call, and the debug layer removes the device. fits now asks typed_store (D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) about the format the view really takes and rejects the ones the host cannot store, so the slot falls back to the existing null-view path.
shortcut: such views are null and their writes dropped; map the format
to one the host can store (of the same bit width) when the world needs them.

What it changes in the title

Before: device removed after ~550 frames at the start of the world load (DXGI_ERROR_INVALID_CALL).
After: the world loads, mesh pipelines run, menus at 30 fps; the title then dies of DXGI_ERROR_DEVICE_HUNG — 1428 draws a frame at 4282 ms/frame, an 8 s submission. That is a throughput problem (world batching/culling), not an invalid call, and is not addressed here.

Verification

  • cargo test -p victory-gpu: 141 passed, 2 failed — descriptor::host::tests::dynamic_slots_are_held_until_released and memory::tests::lists_share_a_table_and_copies_keep_their_views, both failing on main before this change.
  • cargo check -p victory-gpu clean; the touched hunks are rustfmt-clean (the crate has pre-existing formatting drift under rustfmt 1.98.1).
  • Run with the debug layer on I:\GTA6-Xbox: 13 stored messages drain, and the two errors above no longer appear; the remaining warnings are the descriptor-heap cap, pipeline-library misses, a missing RTV slot and the TDR.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6605516512 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2431). Originally posted by [FoxxoOwO](https://github.com/FoxxoOwO) on 2026-11-25T13:25:22Z. --- The D3D12 debug layer (previously unusable — the app's `diagnostics` feature did not forward to `victory-gpu`, so `VICTORY_D3D12_DEBUG` and `VICTORY_D3D12_WARP` could never turn on) names two calls that remove the device while the title loads its world. Both are gone: - `crates/victory-gpu/src/resource.rs` in `shared_texture`: `GetResourceAllocationInfo` was asked about the *title's* texture description, which may carry `ALLOW_UNORDERED_ACCESS` in a format the host cannot view as unordered access — an invalid call, answered by device removal. It now asks the live host texture's own description. The result is only the `SAVED` statistic of shared bytes. - `crates/victory-gpu/src/descriptor/host.rs` in `fits`: a texture unordered view took the title's view format unconditionally. `CreateUnorderedAccessView` with `B5G5R5A1_UNORM` (the menu's) is an invalid call, and the debug layer removes the device. `fits` now asks `typed_store` (`D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW`) about the format the view really takes and rejects the ones the host cannot store, so the slot falls back to the existing null-view path. ``` shortcut: such views are null and their writes dropped; map the format to one the host can store (of the same bit width) when the world needs them. ``` ### What it changes in the title Before: device removed after ~550 frames at the start of the world load (`DXGI_ERROR_INVALID_CALL`). After: the world loads, mesh pipelines run, menus at 30 fps; the title then dies of `DXGI_ERROR_DEVICE_HUNG` — 1428 draws a frame at 4282 ms/frame, an 8 s submission. That is a throughput problem (world batching/culling), not an invalid call, and is not addressed here. ### Verification - `cargo test -p victory-gpu`: 141 passed, 2 failed — `descriptor::host::tests::dynamic_slots_are_held_until_released` and `memory::tests::lists_share_a_table_and_copies_keep_their_views`, both failing on `main` before this change. - `cargo check -p victory-gpu` clean; the touched hunks are `rustfmt`-clean (the crate has pre-existing formatting drift under rustfmt 1.98.1). - Run with the debug layer on `I:\GTA6-Xbox`: 13 stored messages drain, and the two errors above no longer appear; the remaining warnings are the descriptor-heap cap, pipeline-library misses, a missing RTV slot and the TDR.
upstream-sync closed this pull request 2026-11-25 14:06:56 +00:00
FoxxoOwO commented 2026-11-25 14:07:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by FoxxoOwO on 2026-11-25T13:25:52Z.


Superseded by #2432: this branch was stacked on the queries branch (gpu/queries-host), so the diff carried that work; #2432 is the same commit rebased onto main.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7163766087 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2431#issuecomment-7163766087). Originally posted by [FoxxoOwO](https://github.com/FoxxoOwO) on 2026-11-25T13:25:52Z. --- Superseded by #2432: this branch was stacked on the queries branch (gpu/queries-host), so the diff carried that work; #2432 is the same commit rebased onto main.
catminou4 commented 2026-11-25 15:03:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:11:12Z.

Review: COMMENTED


Two invalid title calls + diagnostics (+272, README+apps+gpu). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.

<!-- greyfinch-sync:Marvisak/VIctory:review:6059175652 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2431#pullrequestreview-6059175652). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T14:11:12Z. **Review:** COMMENTED --- Two invalid title calls + diagnostics (+272, README+apps+gpu). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.

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
Marvisak/VIctory!2429
No description provided.