GPU: Add mesh-to-compute fallback for RDNA1 #20

Open
Abdellah-Khanani wants to merge 5 commits from upstream-pr/20 into main
Abdellah-Khanani commented 2026-11-25 23:38:55 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by Abdellah-Khanani on 2026-11-25T23:38:55Z.


What this does

Adds a mesh-to-compute path for D3D12 adapters without native mesh shaders, aimed at RDNA1 GPUs such as the Radeon RX 5700 XT. The translator emits the mesh program as compute plus a vertex shader, and the host submits generated geometry through an indirect draw. The fallback uses a dedicated compute root signature and list-owned scratch buffers.

Also declares wave64 for the fallback, keeps mesh output limits intact for compute lowering, applies the host blend-state workaround for integer render targets, and makes the fallback scratch-pool limits configurable.

Local validation

  • cargo build --locked --profile diag -p victory --features diagnostics succeeds.
  • On an RX 5700 XT, VIctory reaches the Rockstar intro and loading artwork at about 30 FPS.
  • It still fails while transitioning toward gameplay: D3D12 reports an invalid host command list on close (0x80004005). The Windows D3D12 debug layer is unavailable on this machine, so the offending command is not identified yet.

This is published as a draft because the first actual gameplay scene is not verified yet.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5501097007 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/20). Originally posted by [Abdellah-Khanani](https://github.com/Abdellah-Khanani) on 2026-11-25T23:38:55Z. --- ## What this does Adds a mesh-to-compute path for D3D12 adapters without native mesh shaders, aimed at RDNA1 GPUs such as the Radeon RX 5700 XT. The translator emits the mesh program as compute plus a vertex shader, and the host submits generated geometry through an indirect draw. The fallback uses a dedicated compute root signature and list-owned scratch buffers. Also declares wave64 for the fallback, keeps mesh output limits intact for compute lowering, applies the host blend-state workaround for integer render targets, and makes the fallback scratch-pool limits configurable. ## Local validation - `cargo build --locked --profile diag -p victory --features diagnostics` succeeds. - On an RX 5700 XT, VIctory reaches the Rockstar intro and loading artwork at about 30 FPS. - It still fails while transitioning toward gameplay: D3D12 reports an invalid host command list on close (`0x80004005`). The Windows D3D12 debug layer is unavailable on this machine, so the offending command is not identified yet. This is published as a draft because the first actual gameplay scene is not verified yet.
delacor commented 2026-11-27 12:05:39 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by delacor on 2026-11-27T12:05:39Z.


Linux/RDNA1 progress update from our local integration on an RX 5500 XT 8 GiB with Wine/vkd3d-proton: the opening 3D room and character geometry are now visible using the compute fallback plus additional fixes. Face/shading artifacts and dropped passes remain, so this is not an end-to-end rendering correctness claim.

Our backend accepts the state-changing indirect signatures but produces no mesh work with device-generated commands disabled. Explicit output bindings and ordinary indirect compute/draw pairs restore geometry, with each pair finishing its read before output reuse. Five actual GPU regressions pass, including multiple records whose combined storage exceeds one region. Native mesh execution keeps its existing path.

We also tested an opt-in shared Data output allocator across host lists on the single DIRECT queue. Indirect command buffers stay private; group counts, layout, capacity and write/read dependencies are preserved. Earlier size allocations remain owned after growth. The existing pool already recycles output after each draw; this addresses retention across simultaneously live lists.

Same-executable sequential comparison Private output pools Shared output storage
Final retained mesh storage 1947 MiB 95 MiB
Peak retained mesh storage 2491 MiB 97 MiB
Peak total observed VRAM usage 7.964 GiB 6.186 GiB
Mean warm frame time 199.526 ms 195.035 ms
FPS calculated from mean frame time 5.012 5.127

The application mesh-storage counter includes command buffers and free/delayed storage; it is not total GPU memory. Warm samples cover 120–410 seconds with no shader compilation (53 private, 51 shared samples). Draw counts differ (1114.42 versus 1104.31 on average), and the shared run had USB/dock hotplug messages. This supports about 95% lower final retained mesh storage, not an established FPS gain. Neither run reported an amdgpu fault/reset.

The shared-storage GPU regression records 32 lists before submission and checks reverse batched order, separate submissions, growth and exact producer/consumer output across 64 lists. It passes and retains 3 MiB in the synthetic case. Barrier/image and indirect regressions, Windows all-target checks and the app build also pass in the integration. Other GPUs, native Windows drivers and long-session behavior remain unverified.

Credit: yoraudev's alternative Marvisak #1648 already uses global intermediate storage. Our experiment adapts that idea to this fallback allocator and translator rather than introducing another emulation implementation. Its benefit is not intrinsically limited to 8-GiB GPUs, but native mesh draws bypass these buffers. No native-path 7900 XTX speedup is claimed.

These are local integration results with follow-up changes, not validation of this PR's unmodified head. The narrow follow-up patches still need extraction against the agreed fallback base; unrelated experiments and private captures/shaders/executables will be excluded. AI-assisted investigation and synthetic regression work with Codex.

Coordinating the same follow-up with Marvisak #961. This does not change the fallback dependency or establish an improvement on the native 7900 path.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7217831606 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/20#issuecomment-7217831606). Originally posted by [delacor](https://github.com/delacor) on 2026-11-27T12:05:39Z. --- Linux/RDNA1 progress update from our local integration on an RX 5500 XT 8 GiB with Wine/vkd3d-proton: the opening 3D room and character geometry are now visible using the compute fallback plus additional fixes. Face/shading artifacts and dropped passes remain, so this is not an end-to-end rendering correctness claim. Our backend accepts the state-changing indirect signatures but produces no mesh work with device-generated commands disabled. Explicit output bindings and ordinary indirect compute/draw pairs restore geometry, with each pair finishing its read before output reuse. Five actual GPU regressions pass, including multiple records whose combined storage exceeds one region. Native mesh execution keeps its existing path. We also tested an opt-in shared **Data output** allocator across host lists on the single DIRECT queue. Indirect command buffers stay private; group counts, layout, capacity and write/read dependencies are preserved. Earlier size allocations remain owned after growth. The existing pool already recycles output after each draw; this addresses retention across simultaneously live lists. | Same-executable sequential comparison | Private output pools | Shared output storage | |---|---:|---:| | Final retained mesh storage | 1947 MiB | 95 MiB | | Peak retained mesh storage | 2491 MiB | 97 MiB | | Peak total observed VRAM usage | 7.964 GiB | 6.186 GiB | | Mean warm frame time | 199.526 ms | 195.035 ms | | FPS calculated from mean frame time | 5.012 | 5.127 | The application mesh-storage counter includes command buffers and free/delayed storage; it is not total GPU memory. Warm samples cover 120–410 seconds with no shader compilation (53 private, 51 shared samples). Draw counts differ (1114.42 versus 1104.31 on average), and the shared run had USB/dock hotplug messages. This supports about **95% lower final retained mesh storage**, not an established FPS gain. Neither run reported an amdgpu fault/reset. The shared-storage GPU regression records 32 lists before submission and checks reverse batched order, separate submissions, growth and exact producer/consumer output across 64 lists. It passes and retains 3 MiB in the synthetic case. Barrier/image and indirect regressions, Windows all-target checks and the app build also pass in the integration. Other GPUs, native Windows drivers and long-session behavior remain unverified. Credit: yoraudev's alternative [Marvisak #1648](https://github.com/Marvisak/VIctory/pull/1648) already uses global intermediate storage. Our experiment adapts that idea to this fallback allocator and translator rather than introducing another emulation implementation. Its benefit is not intrinsically limited to 8-GiB GPUs, but native mesh draws bypass these buffers. No native-path 7900 XTX speedup is claimed. These are local integration results with follow-up changes, not validation of this PR's unmodified head. The narrow follow-up patches still need extraction against the agreed fallback base; unrelated experiments and private captures/shaders/executables will be excluded. AI-assisted investigation and synthetic regression work with Codex. Coordinating the same follow-up with [Marvisak #961](https://github.com/Marvisak/VIctory/pull/961). This does not change the fallback dependency or establish an improvement on the native 7900 path.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/20:upstream-pr/20'
git switch 'upstream-pr/20'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/20'
git switch 'upstream-pr/20'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/20'
git switch 'upstream-pr/20'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/20'
git switch 'main'
git merge --squash 'upstream-pr/20'
git switch 'main'
git merge --ff-only 'upstream-pr/20'
git switch 'main'
git merge 'upstream-pr/20'
git push origin 'main'
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
avatarmanz/VIctory-7900XTX!20
No description provided.