Pipelines: static samplers are first made in the same order in every launch (the picture no longer depends on who filled the library) #1461
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1461"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from fxceless/victory-fork. Originally posted by KyleS98 on 2026-11-27T11:43:10Z.
Fixes #1459 as far as I can test it: on an NVIDIA card the title's picture depended on which launches had filled the pipeline library.
What
A new
crates/victory-gpu/src/pipeline/samplers.rskeeps the order in which the host first sees the different static samplers the same in every launch.static-samplers.txtbeside the library, in the order they were first made (ten words a line: filter, three address modes, bias, maximum anisotropy, comparison function, border colour, first and last level).VICTORY_SAMPLER_ORDER=0turns all of it off.VICTORY_EXTRA_STATIC_SAMPLER=1(diagnostics builds) makes one more static sampler, unlike the title's own, before the title's first root signature. With the order off that reproduces the issue on a filled library; with the order on it shows the issue gone.The hook is one call in
pipeline::host::root_signature, the only place the title's root signatures are made.Why this, and what it rests on
What I measured is in #1459: 20 runs of 20 wrong with one more unlike static sampler made early, 0 of 12 without; one build with one set of switches wrong on a library that launches of another configuration had filled, right from an empty one.
What I concluded is a guess about the driver: it numbers a device's different static samplers in the order they are first made, a compiled pipeline names them by number, and a pipeline kept in the library keeps the numbers of the launch that compiled it. I cannot look inside the driver. The test below is what I have for it: with the order kept, the case that was wrong 20 times of 20 is right.
If the guess is wrong in a way this test does not show (numbers given by something other than first use, say), the list would not be enough and the sturdier way would be no static samplers in translated pipelines at all. I have not tried that.
Tested
Unit: three tests in the module (a sampler's line; a list's order and a line cut short; on the host device, a new sampler goes to the file's end and a second start reads the same order back). Clippy is clean with and without
diagnostics.In the game: RTX 3090 Ti, driver 616.92, Windows 11 26200,
--console series-s, this branch with #798 merged in (so that this profile's world shows), a cache folder of its own, 360 to 400 s a launch, hands off, the prologue's cell.VICTORY_EXTRA_STATIC_SAMPLER=1VICTORY_SAMPLER_ORDER=0 VICTORY_EXTRA_STATIC_SAMPLER=1No exception in any of the four.
Limits
AI-assisted (Claude Code, Claude Fable 5.2); runs and grabs on my machine; no game data in the change.
Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-27T11:54:05Z.
I tested the static-sampler ordering mechanism in the NVIDIA fork's standalone SM 6.6 3D LUT probe on an RTX 5060 Laptop GPU (8 GiB), Bazzite 44, driver 615.78.08, GE-Proton11-14, and vkd3d-proton 3.2.0 (
cae8353ed7959c4+). The synthetic shaders and sampler settings were kept. The fixture used signed DXC and the null/zero native library call from #885. I disabled vkd3d's internal shader disk cache and used the same immutable explicit library blob in the load arms.Three fresh processes stored a pipeline, loaded it, and loaded it after creating ten unrelated static samplers. Both load arms logged that the native library supplied the pipeline. All 64 RGB readbacks matched across the three arms at the printed precision, with maximum error 0.0003 against linear interpolation. This covers the synthetic ordering mechanism on that Proton stack. The reported Windows title result uses a different driver path and workload.
One migration interaction on Proton is independently reproducible. When an unlisted old cache is discarded, creating the new native library needs the null/zero call from #885 on this vkd3d build. The empty-slice call rejects it at creation.
Assisted by Codex (GPT-6.2-Sol High).
Imported from fxceless/victory-fork. Originally posted by KyleS98 on 2026-11-27T12:35:07Z.
@Filip722 thank you, that is an arm I could not run. So on Proton with vkd3d-proton a stored pipeline does not pick up the order of the static samplers made before it is loaded: 64 of 64 readbacks equal after ten unrelated samplers. The fault in #1459 is then one of NVIDIA's Windows driver behind the native pipeline library, as far as the two results go together, and on your stack this change only costs the list's few root signatures at start.
On the migration:
mainmakes its library from an empty slice whenever there is no file (openwith no bytes: "no host pipeline library yet; starting an empty one"), so a first launch on a fresh cache folder meets the same refusal on that vkd3d build with or without this PR. What this PR adds is that an existing cache is put into that state once. Your #885 covers both.If the maintainers would rather not let a library go on stacks where the order does no harm, the discard can go behind a switch of its own or be left out under Wine. I have not done either, because I have no such stack to test it on.
AI-assisted (Claude Code, Claude Fable 5.2).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.