vkback: one sampler per distinct description #167

Manually merged
github merged 1 commit from github-bot/gh-167 into gh-pr/167/base 2026-12-02 19:44:35 +00:00 AGit
Owner

@⁠360900 on GitHub · 2026-12-01 23:12 UTC · original
360900:fix/one-sampler → main · +52 −36 · 8 files · 1 commits · merged 2026-12-02 19:38 UTC

What

A Vulkan sampler is made once per distinct description and kept for the device's life (layout::sampler, Dev::samplers). Before, every pipeline made the static samplers of its set 2 anew and kept them with it.

The reference

vkd3d-proton keeps one sampler per description too (vkd3d_sampler_state_create_static_sampler, a map on the device).

Evidence

  • RTX 5080, NVIDIA 620.73.04, Linux 7.3: maxSamplerAllocationCount is 4,000 there. Validation run (layer 1.4.363, start to the first minutes in the world): VUID-vkCreateSampler-maxSamplerAllocationCount-04110 before, gone with this. The driver itself never refused a sampler.
  • Card test one_sampler_a_description (-- --ignored): the same description gives the same sampler, another one another.
  • 480 s world run under the layer: no new error, no device loss.
  • Not run on RADV: no AMD card here.
  • In-game and validation results are from the build with all nine NVIDIA pull requests: the title does not start on this driver without the umem one.

Checklist (docs/AGENTS.md)

  • One topic (rule 31); docs/TASKS.md not edited (rule 29)
  • "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen
  • No fallback or second path for a case that can't happen (rule 33); unexpected input fails loudly (rule 9)
  • Constants come from the console, the hardware or the title's data (rule 9b)
  • Every switch is listed, read in one place, and a bad value stops the start (rule 2): no new switches
  • Queues and other externally synchronized Vulkan objects are used under their lock (rule 35): the map is behind a mutex
  • Every unsafe block has a // SAFETY: comment (rule 36): the new block has it
  • Clippy clean; tests call the production code; TRANSLATOR_VERSION: the translator is not touched (rule 27)
  • Comments say what is true now and name functions, not line numbers (rule 3)
  • Nothing from the title, and no pointers to where non-free data can be found
**@⁠360900** on GitHub · 2026-12-01 23:12 UTC · [original](https://github.com/vktory6/VKtory/pull/167) `360900:fix/one-sampler` → `main` · +52 −36 · 8 files · 1 commits · merged 2026-12-02 19:38 UTC ## What A Vulkan sampler is made once per distinct description and kept for the device's life (`layout::sampler`, `Dev::samplers`). Before, every pipeline made the static samplers of its set 2 anew and kept them with it. ## The reference vkd3d-proton keeps one sampler per description too (`vkd3d_sampler_state_create_static_sampler`, a map on the device). ## Evidence - RTX 5080, NVIDIA 620.73.04, Linux 7.3: `maxSamplerAllocationCount` is 4,000 there. Validation run (layer 1.4.363, start to the first minutes in the world): `VUID-vkCreateSampler-maxSamplerAllocationCount-04110` before, gone with this. The driver itself never refused a sampler. - Card test `one_sampler_a_description` (`-- --ignored`): the same description gives the same sampler, another one another. - 480 s world run under the layer: no new error, no device loss. - Not run on RADV: no AMD card here. - In-game and validation results are from the build with all nine NVIDIA pull requests: the title does not start on this driver without the umem one. ## Checklist (docs/AGENTS.md) - [x] One topic (rule 31); `docs/TASKS.md` not edited (rule 29) - [x] "Allow edits by maintainers" on; after review, no force-push and no close-and-reopen - [x] No fallback or second path for a case that can't happen (rule 33); unexpected input fails loudly (rule 9) - [x] Constants come from the console, the hardware or the title's data (rule 9b) - [x] Every switch is listed, read in one place, and a bad value stops the start (rule 2): no new switches - [x] Queues and other externally synchronized Vulkan objects are used under their lock (rule 35): the map is behind a mutex - [x] Every `unsafe` block has a `// SAFETY:` comment (rule 36): the new block has it - [x] Clippy clean; tests call the production code; `TRANSLATOR_VERSION`: the translator is not touched (rule 27) - [x] Comments say what is true now and name functions, not line numbers (rule 3) - [x] Nothing from the title, and no pointers to where non-free data can be found
Each pipeline made its static samplers anew: past the 4,000 a device may allow at a time (VUID-vkCreateSampler-maxSamplerAllocationCount-04110).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 23:16:10 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 19:39 UTC · original

Merged, thanks. Checked together with the rest of the NVIDIA set on the reference card (RX 9070 XT): unit tests pass, and a house validation run with all six applied showed no new validation errors, no device loss and the expected counters.

**@⁠vktory6** on GitHub · 2026-12-02 19:39 UTC · [original](https://github.com/vktory6/VKtory/pull/167#issuecomment-7356507957) Merged, thanks. Checked together with the rest of the NVIDIA set on the reference card (RX 9070 XT): unit tests pass, and a house validation run with all six applied showed no new validation errors, no device loss and the expected counters.
github-bot changed target branch from main to gh-pr/167/base 2026-12-02 19:44:33 +00:00
github manually merged commit a742535d07 into gh-pr/167/base 2026-12-02 19:44:35 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.