shader: a comparison sampler replaces the reduction instead of OR-ing into it #2812

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

@⁠spy0eye-beep on GitHub · 2026-11-25 21:14 UTC · original
spy0eye-beep:fix/comparison-sampler-reduction → main · +30 −5 · 2 files · 1 commits · open

Split out of #1483 as requested in review.

D3D12 keeps the reduction in filter bits 7-8 (0 standard, 1 comparison, 2 minimum, 3 maximum). OR-ing 0x80 into a minimum sampler (0x100) produced a maximum one (0x180). StaticSampler::make_comparison clears the reduction and sets comparison; both call sites use it, and the existing immediate_sampler_slots_distinguish_comparison_uses expectation is updated rather than duplicated.

Test: comparison_replaces_the_reduction covers standard, minimum and maximum reductions with point, linear and anisotropic filters.

🤖 Generated with Claude Code

**@⁠spy0eye-beep** on GitHub · 2026-11-25 21:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/2812) `spy0eye-beep:fix/comparison-sampler-reduction` → `main` · +30 −5 · 2 files · 1 commits · open Split out of #1483 as requested in review. D3D12 keeps the reduction in filter bits 7-8 (0 standard, 1 comparison, 2 minimum, 3 maximum). OR-ing 0x80 into a minimum sampler (0x100) produced a maximum one (0x180). `StaticSampler::make_comparison` clears the reduction and sets comparison; both call sites use it, and the existing `immediate_sampler_slots_distinguish_comparison_uses` expectation is updated rather than duplicated. Test: `comparison_replaces_the_reduction` covers standard, minimum and maximum reductions with point, linear and anisotropic filters. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The comparison bit was OR-ed into a filter that already holds the
reduction in bits 7-8, which turned a minimum sampler (0x100) into a
maximum one (0x180). StaticSampler::make_comparison replaces the
reduction; comparison_replaces_the_reduction covers standard, minimum and
maximum reductions. immediate_sampler_slots_distinguish_comparison_uses
builds its expectation with it too.

Split out of #1483.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:14:51 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 21:33 UTC · original

Verified 333e39c3 on Windows 11 (RTX 5090 + WARP + Windows SDK 10.0.26100.0 dxil.dll):

  • cargo xtask policy: 184 files ok; cargo clippy -p victory-shader --all-targets --locked -- -D warnings (default & --features host): 0 warnings.
  • emit::sampler:: + immediate_sampler_slots_distinguish_comparison_uses: 6/6 passed (with dxil.dll validation).
  • Clean git merge-tree against origin/main 13f91ca and #2811. StaticSampler::make_comparison() cleanly masks out bits 7–8 (& !0x180 | 0x80) before setting comparison mode across both emit_with and the test, cleanly superseding the sampler portion of #1483.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 21:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2812#issuecomment-7175229300) Verified `333e39c3` on Windows 11 (RTX 5090 + WARP + Windows SDK `10.0.26100.0` `dxil.dll`): - `cargo xtask policy`: 184 files ok; `cargo clippy -p victory-shader --all-targets --locked -- -D warnings` (default & `--features host`): 0 warnings. - `emit::sampler::` + `immediate_sampler_slots_distinguish_comparison_uses`: 6/6 passed (with `dxil.dll` validation). - Clean `git merge-tree` against `origin/main` `13f91ca` and #2811. `StaticSampler::make_comparison()` cleanly masks out bits 7–8 (`& !0x180 | 0x80`) before setting comparison mode across both `emit_with` and the test, cleanly superseding the sampler portion of #1483.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 02:20 UTC · original

Automated triage for the maintainers.

StaticSampler::make_comparison (emit/sampler.rs) clears the reduction bits (7-8) before setting comparison. OR-ing 0x80 into a minimum sampler (0x100) gave a maximum one (0x180). Both call sites in emit/mod.rs use it, and the test covers standard/min/max reductions with point, linear and anisotropic filters. It is small and correct by my reading of D3D12's D3D12_FILTER encoding.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 02:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/2812#issuecomment-7180701905) <!-- victory-triage v1 head=333e39c37122d9fad2999cd7068a60c7ce9e4e64 verdict=merge-candidate at=2026-11-26T02:19:57Z --> Automated triage for the maintainers. `StaticSampler::make_comparison` (`emit/sampler.rs`) clears the reduction bits (7-8) before setting comparison. OR-ing `0x80` into a minimum sampler (`0x100`) gave a maximum one (`0x180`). Both call sites in `emit/mod.rs` use it, and the test covers standard/min/max reductions with point, linear and anisotropic filters. It is small and correct by my reading of D3D12's `D3D12_FILTER` encoding. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/2812/head:github-bot/gh-2812'
git switch 'github-bot/gh-2812'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2812'
git switch 'github-bot/gh-2812'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2812'
git switch 'github-bot/gh-2812'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2812'
git switch 'main'
git merge --squash 'github-bot/gh-2812'
git switch 'main'
git merge --ff-only 'github-bot/gh-2812'
git switch 'main'
git merge 'github-bot/gh-2812'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2812
No description provided.