GPU: heap samplers keep point mips when anisotropic, as static samplers do #2031
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2031
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2031/head"
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?
@0xkn0wh3r3 on GitHub · 2026-11-25 03:44 UTC · original
0xkn0wh3r3:gpu/heap-samplers-keep-point-mips→main· +121 −31 · 3 files · 2 commits · merged 2026-11-25 21:53 UTCThe problem
An anisotropic sampler with point mips blended between mip levels on the host, where the console does not.
A sampler the title makes in a descriptor heap from the console's description (
CreateSamplerX,sampler::console) became D3D12's plain anisotropic filter (0x55) whenever its magnification or minification was anisotropic, whatever its mip filter. 0x55 is anisotropic with linear mips.Static samplers in shader code already keep point mips since #1337 (
StaticSampler::filter_for_host), on hosts with anisotropic point-mip filtering (D3D12_OPTIONS19). Heap samplers did not.The fix
sampler::aniso_point_mip). Pipeline creation uses the same answer instead of asking per pipeline.Non-anisotropic samplers are unchanged.
Testing
anisotropic_samplers_keep_point_mips_where_the_host_can: checks the filter for point, linear and no mips, with and without the feature, and with comparison and maximum reduction. On main the point-mip case gives 0x55.the_host_takes_its_anisotropic_samplers: makes such a sampler in a sampler heap on the host device and checks the device is not removed. An RTX 5070 Ti reports the feature, so it takes 0x54.cargo test -p victory-gpu --no-fail-faston an RTX 5070 Ti (driver 621.24): 143 passed.descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_viewsfail the same way onmain(NVIDIA's 1,000,000-descriptor heap cap, #1835).cargo clippy -p victory-gpu --all-targets, with and without--features diagnostics: clean.Not covered
@jeremygold02 on GitHub · 2026-11-25 03:56 UTC · original
Triage verdict — Keep as the heap-sampler follow-up (
f2e8623)Evidence
mainstill chooses linear mips for anisotropic filters. The guarded point-mip encoding matches the DirectX specification, and adapters without the feature keep the existing linear fallback. Sampler mapping · DirectX capability and encodingsChecks and limits
Next step
0x154and0x155) and make the device test report whether it reached sampler creation.This verification was AI-assisted.
@0xkn0wh3r3 on GitHub · 2026-11-25 06:27 UTC · original
Thanks @jeremygold02, done in
4036fbe. The mapping test now also covers minimum reduction,0x154with point-mip support and0x155without, plus maximum reduction without support (0x1d5). The device test now prints that it made its sampler and which filter it used, or that it skipped because there was no device, so a green run shows which happened. On an RTX 5070 Ti it reportsmade an anisotropic sampler, filter 0x54.@Marvisak on GitHub · 2026-11-25 09:19 UTC · original · edited 2026-11-25 20:20 UTC
Automated triage for the maintainers.
Merge candidate (unchanged; same head as the last triage).
crates/victory-gpu/src/sampler.rs,Fields::host: anisotropic heap samplers now use filter 0x54 (anisotropic, point mips, with comparison/reduction bits kept) when the console asks for point or no mips and the host reports anisotropic point-mip support, and 0x55 otherwise, matching whatmainalready does for static samplers (#1337). The OPTIONS19 query is cached insampler::aniso_point_mipand shared withpipeline/host.rs. Nothing on currentmainchanges this mapping.Since the last triage, a contributor sampled real mips through
CreateSamplerXon WARP: point mips return the exact levels on this head ([0.25, 0.75]) and blend onmain([0.375, 0.625]), with the linear-mip control unchanged. That is good end-to-end support for the change.Reply to the author: understood that the WARP sampling test stays as the contributor's own commit; the maintainers can take it separately. No new code to review, so the verdict stands.
CI: not run on this head (the workflow appears to be waiting for approval). Run it before merging.
Recommending a look, not approving.
Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 17:18 UTC · original
I checked actual sampling on Windows/WARP with OPTIONS19 reporting anisotropic point-mip support. The fixture creates console heap samplers through CreateSamplerX and samples two constant R32_FLOAT mip levels at LOD 0.25 and 0.75.
940d32fand current main13f91careturn [0.375, 0.625] for both point and linear mips.4036fbereturns [0.25, 0.75] for point mips and [0.375, 0.625] for the linear control. The same test passed six runs across both D3D12 debug flag settings.13f91ca. Strict GPU Clippy in both modes and repository policy passed on the exact PR branch plus the test.The test-only commit is directly on
4036fbe4ff. If you cherry-pick it, please preserve its Git author. If you fold it into another commit, please add the trailer below. Test commitCo-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted. Synthetic texture data only.
@0xkn0wh3r3 on GitHub · 2026-11-25 18:37 UTC · original
@Xvania7 thanks. @andrewpozdnakov7-jpg, thanks for sampling it end to end on WARP. [0.25, 0.75] for point mips against [0.375, 0.625] for the linear control is exactly the behaviour the unit tests only check at the descriptor level. I'd rather keep your test as your own commit than fold it into mine. If the maintainer wants it in, it can go in as it is, with your authorship.