GPU: decode each shader once for both store classifications (#1055) #1203

Merged
Yuanzer merged 3 commits from upstream-pr/1203 into main 2026-11-30 14:12:04 +00:00
Yuanzer commented 2026-11-28 15:30:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Yuanzer on 2026-11-28T15:30:58Z.


The problem

pipeline::translate classified each native shader once with stores and once with stores_by_address. Both predicates call victory_shader::gfx10::decode on the same code, so a shader without stores, or one where both classifications were needed, decoded its program twice for these two booleans.

Fixes #1055.

The change

  • Decode each native program once and derive both classification flags in that pass.
  • Preserve the original conservative result: empty programs and code that does not decode still report both true.
  • Stop scanning a program as soon as both kinds are known, and stop scanning the program list once both aggregate flags are known.
  • Keep texture stores and scratch stores out of stores, as before.

No cache or persistent state is introduced.

Tests

  • New pipeline::tests::store_classification_keeps_both_kinds: no-store, buffer-store, flat-store, global-store, scratch-store, empty-program, undecodable-code, and multi-program aggregation.
  • cargo test -p victory-gpu --lib --locked: 455 passed, 0 failed, 36 ignored.
  • cargo check -p victory-gpu --all-targets --all-features --locked: passed.

I did not run the game or claim an FPS change. The local toolchain's rustfmt and clippy components were unavailable, so CI remains the authoritative lint check.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5541744560 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1203). Originally posted by [Yuanzer](https://github.com/Yuanzer) on 2026-11-28T15:30:58Z. --- ## The problem `pipeline::translate` classified each native shader once with `stores` and once with `stores_by_address`. Both predicates call `victory_shader::gfx10::decode` on the same code, so a shader without stores, or one where both classifications were needed, decoded its program twice for these two booleans. Fixes #1055. ## The change - Decode each native program once and derive both classification flags in that pass. - Preserve the original conservative result: empty programs and code that does not decode still report both `true`. - Stop scanning a program as soon as both kinds are known, and stop scanning the program list once both aggregate flags are known. - Keep texture stores and scratch stores out of `stores`, as before. No cache or persistent state is introduced. ## Tests - New `pipeline::tests::store_classification_keeps_both_kinds`: no-store, buffer-store, flat-store, global-store, scratch-store, empty-program, undecodable-code, and multi-program aggregation. - `cargo test -p victory-gpu --lib --locked`: 455 passed, 0 failed, 36 ignored. - `cargo check -p victory-gpu --all-targets --all-features --locked`: passed. I did not run the game or claim an FPS change. The local toolchain's rustfmt and clippy components were unavailable, so CI remains the authoritative lint check.
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
trustno1-coder/VIctory-NVIDIA!1203
No description provided.