fix: preserve point mips for anisotropic heap samplers #326

Open
github-bot wants to merge 1 commit from github-bot/gh-326 into main AGit
Owner

@⁠mauroalvare on GitHub · 2026-11-26 03:21 UTC · original
mauroalvare:codex/victory-anisotropic-point-mips → main · +308 −10 · 4 files · 1 commits · open

Change

Neptune's CreateSamplerX materializer used D3D12_FILTER_ANISOTROPIC (0x55) for every anisotropic heap sampler. In a two-level texture, a sampler that requested point mip selection therefore returned a blend of both levels.

Use D3D12_OPTIONS19 to check AnisoFilterWithPointMipSupported once for the host device. Choose 0x54 for point mip selection when supported, including the sampler's reduction bits. 0x55 supplies linear mips and the compatibility fallback for devices that lack the optional filter. This exercises the View::ConsoleSampler path in the Neptune D3D12 backend built by tools/lancer_victory.ps1. DirectX capability specification

The implementation adapts Flare's heap sampler change to Neptune and adds a texture sampling readback. The commit trailer and THIRD_PARTY.md record the source and licence. VIctory source commit

Verification

Base c4c93bdc413191a9dc909998d2d53080a3f0c880 and fix 44fd0b5228d4c5500f297b0de11c6eb05d9bf9f6. To reproduce the base, add anisotropic_sampler_tests.rs and its #[cfg(test)] module declaration from this PR to the base revision. Run from third_party/victory. Leave VICTORY_D3D12_WARP unset for NVIDIA or set it to 1 for WARP.

cargo test --locked --offline -p victory-gpu --lib --features diagnostics descriptor::host::anisotropic_sampler_tests::anisotropic_heap_sampler_reads_the_requested_mip -- --exact --nocapture --test-threads=1
Adapter Base point sampler Fixed point sampler Native linear control on both revisions
GeForce RTX 5070 Ti, driver 621.40 [0.06640726, 0.94140536] [0.0, 1.0] [0.06640726, 0.94140536]
WARP, Microsoft Basic Render Driver [0.25, 0.75] [0.0, 1.0] [0.25, 0.75]

Both adapters reported OPTIONS19=true and aniso_point_mip=true. On each adapter the base failed the point-sampling assertion and the fix passed with no skips. The differing linear blend weights also occur with the native control. The GPU test checks that its local control blends and uses it as the fallback oracle.

  • cargo test --locked --offline -p victory-gpu --lib --features diagnostics sampler::tests:: -- --test-threads=1 reported 2 passed.
  • cargo test --locked --offline -p victory-gpu --lib --features diagnostics -- --test-threads=1 reported 198 passed, 3 failed, 3 ignored. The matching main baseline had 196 passed, 3 failed, 3 ignored. The same assertions failed in spans_say_the_next_start_and_the_lowest_level_viewed, warp_card_fetch_copies_flagged_pieces_to_their_slots, and warp_card_patch_writes_the_masked_bytes_and_no_others.
  • cargo test --locked --offline -p victory-loader --test load_probe reported 2 passed.
  • cargo build --locked --offline --release -p victory passed.
  • cargo xtask policy reported asset policy: 200 files ok.
  • cargo build --release --locked --offline --manifest-path rust/Cargo.toml passed. cargo test --release --locked --offline --manifest-path rust/Cargo.toml reported 12 passed in total.
  • python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools reported All checks passed!.
  • python -m pytest -rs with ANYXBOXX_REQUIRE_RUNTIME=1 on Python 3.13.15 reported 1665 passed in 336.77s (0:05:36) with no skips.

Oracle and test data

The fixture clears the mip levels of a synthetic 2×2 texture to 0 and 1. One compute thread samples both the console heap sampler and a native D3D12 anisotropic linear-mip control at explicit LODs 0.25 and 0.75, then writes the results to a UAV. The point result must select the two uniform levels. The CPU test also exercises the filter mapping for a simulated unsupported device and for each reduction mode.

Checklist

  • One change to mip selection in anisotropic heap samplers.
  • Regression fails on the base and passes on the fix.
  • Commands, exact revisions and results recorded above.
  • Synthetic data and source attribution verified.

AI assistance was used for investigation, implementation, and verification with OpenAI Codex.

**@⁠mauroalvare** on GitHub · 2026-11-26 03:21 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/326) `mauroalvare:codex/victory-anisotropic-point-mips` → `main` · +308 −10 · 4 files · 1 commits · open ## Change Neptune's `CreateSamplerX` materializer used `D3D12_FILTER_ANISOTROPIC` (`0x55`) for every anisotropic heap sampler. In a two-level texture, a sampler that requested point mip selection therefore returned a blend of both levels. Use `D3D12_OPTIONS19` to check `AnisoFilterWithPointMipSupported` once for the host device. Choose `0x54` for point mip selection when supported, including the sampler's reduction bits. `0x55` supplies linear mips and the compatibility fallback for devices that lack the optional filter. This exercises the `View::ConsoleSampler` path in the Neptune D3D12 backend built by `tools/lancer_victory.ps1`. [DirectX capability specification](https://microsoft.github.io/DirectX-Specs/d3d/VulkanOn12.html#anisotropic-sampler-with-mip-point) The implementation adapts Flare's heap sampler change to Neptune and adds a texture sampling readback. The commit trailer and `THIRD_PARTY.md` record the source and licence. [VIctory source commit](https://github.com/Marvisak/VIctory/commit/94c1ead4ed8499f2ae3c05d4d5f99b28164cc2cf) ## Verification Base `c4c93bdc413191a9dc909998d2d53080a3f0c880` and fix `44fd0b5228d4c5500f297b0de11c6eb05d9bf9f6`. To reproduce the base, add `anisotropic_sampler_tests.rs` and its `#[cfg(test)]` module declaration from this PR to the base revision. Run from `third_party/victory`. Leave `VICTORY_D3D12_WARP` unset for NVIDIA or set it to `1` for WARP. ```powershell cargo test --locked --offline -p victory-gpu --lib --features diagnostics descriptor::host::anisotropic_sampler_tests::anisotropic_heap_sampler_reads_the_requested_mip -- --exact --nocapture --test-threads=1 ``` | Adapter | Base point sampler | Fixed point sampler | Native linear control on both revisions | | --- | --- | --- | --- | | GeForce RTX 5070 Ti, driver 621.40 | `[0.06640726, 0.94140536]` | `[0.0, 1.0]` | `[0.06640726, 0.94140536]` | | WARP, Microsoft Basic Render Driver | `[0.25, 0.75]` | `[0.0, 1.0]` | `[0.25, 0.75]` | Both adapters reported `OPTIONS19=true` and `aniso_point_mip=true`. On each adapter the base failed the point-sampling assertion and the fix passed with no skips. The differing linear blend weights also occur with the native control. The GPU test checks that its local control blends and uses it as the fallback oracle. - `cargo test --locked --offline -p victory-gpu --lib --features diagnostics sampler::tests:: -- --test-threads=1` reported 2 passed. - `cargo test --locked --offline -p victory-gpu --lib --features diagnostics -- --test-threads=1` reported 198 passed, 3 failed, 3 ignored. The matching `main` baseline had 196 passed, 3 failed, 3 ignored. The same assertions failed in `spans_say_the_next_start_and_the_lowest_level_viewed`, `warp_card_fetch_copies_flagged_pieces_to_their_slots`, and `warp_card_patch_writes_the_masked_bytes_and_no_others`. - `cargo test --locked --offline -p victory-loader --test load_probe` reported 2 passed. - `cargo build --locked --offline --release -p victory` passed. - `cargo xtask policy` reported `asset policy: 200 files ok`. - `cargo build --release --locked --offline --manifest-path rust/Cargo.toml` passed. `cargo test --release --locked --offline --manifest-path rust/Cargo.toml` reported 12 passed in total. - `python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools` reported `All checks passed!`. - `python -m pytest -rs` with `ANYXBOXX_REQUIRE_RUNTIME=1` on Python 3.13.15 reported `1665 passed in 336.77s (0:05:36)` with no skips. ## Oracle and test data The fixture clears the mip levels of a synthetic 2×2 texture to 0 and 1. One compute thread samples both the console heap sampler and a native D3D12 anisotropic linear-mip control at explicit LODs 0.25 and 0.75, then writes the results to a UAV. The point result must select the two uniform levels. The CPU test also exercises the filter mapping for a simulated unsupported device and for each reduction mode. ## Checklist - [x] One change to mip selection in anisotropic heap samplers. - [x] Regression fails on the base and passes on the fix. - [x] Commands, exact revisions and results recorded above. - [x] Synthetic data and source attribution verified. AI assistance was used for investigation, implementation, and verification with OpenAI Codex.
Use the anisotropic point-mip filter for CreateSamplerX when the host
reports OPTIONS19 support. Keep linear mip filtering as the fallback.

Verify the selected mip levels by sampling a two-level synthetic
texture and comparing with a native linear-mip sampler.

Source: Marvisak/VIctory 94c1ead4ed8499f2ae3c05d4d5f99b28164cc2cf
Co-authored-by: Flare <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:43:10 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/326/head:github-bot/gh-326'
git switch 'github-bot/gh-326'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-326'
git switch 'github-bot/gh-326'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-326'
git switch 'github-bot/gh-326'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-326'
git switch 'main'
git merge --squash 'github-bot/gh-326'
git switch 'main'
git merge --ff-only 'github-bot/gh-326'
git switch 'main'
git merge 'github-bot/gh-326'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.