GPU: heap samplers keep point mips when anisotropic, as static samplers do #2029
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2031"
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 Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T03:44:04Z.
The 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
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:57:00Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Heap samplers keep point mips when anisotropic, matching static samplers — consistency fix between heap and static sampler paths.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T03:57:15Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):cargo test -p victory-gpu --lib sampler::— 5 passed, 0 failed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(includinganisotropic_samplers_keep_point_mips_where_the_host_canandthe_host_takes_its_anisotropic_samplers)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean alignment of heap sampler anisotropic point-mip filtering with static samplers, gated on host capability. Looks good.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T03:56:27Z.
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.
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T06:27:35Z.
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.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:19:48Z.
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
Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T11:42:17Z.
Review: APPROVED
Verified
4036fbeon Windows 10 + NVIDIA GeForce RTX 5060:sampler::tests::(5 passed, includinganisotropic_samplers_keep_point_mips_where_the_host_canandthe_host_takes_its_anisotropic_samplers)cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warningscargo xtask policy: 182 files okApproving.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T17:18:01Z.
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.
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T18:37:14Z.
@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.