Improve texture format handling and GPU resource-state management #1092

Closed
github-bot wants to merge 10 commits from gh-pr/1092/head into gh-pr/1092/base
Owner

@⁠Abh-shar on GitHub · 2026-11-24 15:40 UTC · original
ASsDevpile:fix/renderer-investigation → main · +1013 −60 · 17 files · 10 commits · closed without merging

Summary

This PR improves GPU resource handling and indirect draw execution in VIctory.

Changes

  • Refactor texture format handling.
  • Expand support for packed texture formats on the host.
  • Improve buffer state management and resource transitions.
  • Ensure indirect argument budgets remain exhausted once a command list reaches its limit.
  • Improve consistency in GPU resource handling.

Motivation

Address rendering compatibility issues and improve resource-state correctness in the host GPU backend.

Testing

  • Build and runtime validation still required.
  • GTA VI rendering behaviour should be tested, particularly during the transition into the opening world scene.

Scope

4 commits · 10 files changed · 538 additions · 46 deletions

**@⁠Abh-shar** on GitHub · 2026-11-24 15:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/1092) `ASsDevpile:fix/renderer-investigation` → `main` · +1013 −60 · 17 files · 10 commits · closed without merging ## Summary This PR improves GPU resource handling and indirect draw execution in VIctory. ### Changes - Refactor texture format handling. - Expand support for packed texture formats on the host. - Improve buffer state management and resource transitions. - Ensure indirect argument budgets remain exhausted once a command list reaches its limit. - Improve consistency in GPU resource handling. ### Motivation Address rendering compatibility issues and improve resource-state correctness in the host GPU backend. ### Testing - Build and runtime validation still required. - GTA VI rendering behaviour should be tested, particularly during the transition into the opening world scene. ### Scope 4 commits · 10 files changed · 538 additions · 46 deletions
A 32-bit charge word wrapped around the 2^27 budget after 64 heavy
records (each up to about 2^26), re-opening the budget for more work
within the same list. The clamp shader now keeps a spent word beside
the charge: once a record runs empty for the budget, every later
record of the list runs empty too, as the budget's contract states.
The host zeroes both words when it re-records the list.

Co-authored-by: Abh-shar <[email protected]>
Indirect: once a list spends its argument budget, it stays spent
FXC wants the attribute for a compute-shader loop that exits on a
UAV's value; without it the optimizer may treat the condition as
loop-invariant and miscompile the retry.

Co-authored-by: Abh-shar <[email protected]>
Indirect: the budget's CAS retry loop needs allow_uav_condition
The title's 117 wave64 compute pipelines come back 0x80070057 from a
32-lane host device (RTX 30: WaveLaneCountMax 32); wave64 stays refused.
This ports XCL's wave64-on-wave32 mapping as a first cut, off by
default: with the diagnostics feature, VICTORY_SHADER_SPLIT_WAVE64=1
translates a console wave64 compute program of one wave per group (at
most 64 threads) that reads other lanes and declares no group-shared
memory as two wave32 hardware halves. A lazy claim counter gives the
console's lane numbers (the host composes waves in an arbitrary order);
cross-lane reads exchange through group-shared memory and a group
barrier (one console wave per group: both halves traverse the same
blocks, which pairs the exchanges). Ballots, readlane, readfirstlane,
writelane, mbcnt and thread ids follow; quads and DPP stay within a
half, as on the console. Everything else keeps today's translation.

The split is part of the shader cache's build key, like the loop limit.

Diagnostics-under-tests access: a lowering test (Linux, no GPU) checks
the switch's parse and that a wave64 program splits to WaveSize 32 with
the claim counter and exchange slot in group-shared memory, and stays
at WaveSize 64 without it.

Co-authored-by: Abh-shar <[email protected]>
Shader: split wave64 compute into wave32 halves behind an option (XCL's form)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:19:33 +00:00
github-bot closed this pull request 2026-11-26 04:19:33 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 16:29 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 29fe2b0: cargo test -p victory-gpu passes, 54 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 16:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/1092#issuecomment-7137752629) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 29fe2b0: `cargo test -p victory-gpu` passes, 54 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:31 UTC · original

Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/1092#issuecomment-7148603247) Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1092
No description provided.