GPU: zero the padding of blend and depth-stencil descriptions handed to the pipeline library #238

Open
fffluffy-dev wants to merge 1 commit from upstream-pr/238 into main
fffluffy-dev commented 2026-11-24 22:58:24 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by fffluffy-dev on 2026-11-24T22:58:24Z.


GraphicsState::read copies the title's D3D12_BLEND_DESC and D3D12_DEPTH_STENCIL_DESC whole, padding included (3 bytes after each target's RenderTargetWriteMask, 2 after StencilWriteMask). The library compares a loaded pipeline's description with the stored one byte for byte, so a pipeline whose padding differs between runs is refused, made again, and its store is refused as the name exists: it misses on every run. The library name itself is not affected (it hashes describe() text).

This zeroes that padding on the description handed to the host, after which nothing moves it: the graphics desc right after it is built, and the mesh stream (also the gaps between each subobject's type and its description). The idea is Marvisak/VIctory#1690's.

Validation (cargo-xwin, tests under Wine): cargo test -p victory-gpu 111 passed, 1 ignored, new test a_description_s_padding_is_zero_whatever_the_title_left_in_it (descriptions filled with 0x00/0xAB/0xFF before the fields are set come out byte-equal); clippy clean both ways; policy ok. To confirm on a real run: with the debug layer, messages 972/970 on a warm second run, and MADE against LOADED.

AI use: written with Claude Code (Claude Opus 5.5); reviewed and posted with my approval. No game files were used.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593103293 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/238). Originally posted by [fffluffy-dev](https://github.com/fffluffy-dev) on 2026-11-24T22:58:24Z. --- `GraphicsState::read` copies the title's `D3D12_BLEND_DESC` and `D3D12_DEPTH_STENCIL_DESC` whole, padding included (3 bytes after each target's `RenderTargetWriteMask`, 2 after `StencilWriteMask`). The library compares a loaded pipeline's description with the stored one byte for byte, so a pipeline whose padding differs between runs is refused, made again, and its store is refused as the name exists: it misses on every run. The library name itself is not affected (it hashes `describe()` text). This zeroes that padding on the description handed to the host, after which nothing moves it: the graphics desc right after it is built, and the mesh stream (also the gaps between each subobject's type and its description). The idea is Marvisak/VIctory#1690's. Validation (cargo-xwin, tests under Wine): `cargo test -p victory-gpu` 111 passed, 1 ignored, new test `a_description_s_padding_is_zero_whatever_the_title_left_in_it` (descriptions filled with 0x00/0xAB/0xFF before the fields are set come out byte-equal); clippy clean both ways; policy ok. To confirm on a real run: with the debug layer, messages 972/970 on a warm second run, and MADE against LOADED. **AI use:** written with Claude Code (Claude Opus 5.5); reviewed and posted with my approval. No game files were used.
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/238:upstream-pr/238'
git switch 'upstream-pr/238'

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/238'
git switch 'upstream-pr/238'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/238'
git switch 'upstream-pr/238'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/238'
git switch 'main'
git merge --squash 'upstream-pr/238'
git switch 'main'
git merge --ff-only 'upstream-pr/238'
git switch 'main'
git merge 'upstream-pr/238'
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
fxceless/victory-fork!238
No description provided.