Shaders: support multi-way and nested immediate sampler phis #3117
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!3117
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3117"
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?
@fuzeofficlal on GitHub · 2026-11-26 08:43 UTC · original
fuzeofficlal:feat/shader-multi-way-nested-sampler-phi→main· +607 −135 · 5 files · 1 commits · openSummary
Source::Philowering incrates/victory-shader/src/emit/lower.rsbeyond flat two-way[Constant, Constant]pairs to arbitrary multi-way and nestedSource::Phigraphs, with cycle protection (activevisited set),never_takenedge handling, and comparison-mode (cmp_samplers) preservation.self.samplersor emitting IR so mixed (non-constant)Source::Phigraphs fall back cleanly to the existing heap-index path without side effects.i32selector phi and dispatch via generalizedShader::sampler_choices,Module::chosen, andModule::select_indexed(preserving per-fieldextractselection ondx.types.ResRet.f32).crates/victory-shader/src/emit/stride_tests.rscovering a 3-way flat immediate sampler phi and a nested immediate sampler phi exercising both regular and comparison sampling.Verification
cargo test -p victory-shader --locked -- sampler --test-threads=1(RTX 5090 hardware + WARP): 11 passed, 0 failed.VICTORY_WARP=1 cargo test -p victory-shader --locked -- sampler --test-threads=1: 11 passed, 0 failed.cargo test -p victory-shader --locked -- emit::lower::: 33 passed, 0 failed.cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean.cargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings: clean.cargo test -p xtask --locked policy::tests::repository_passes_policy: 1 passed, 0 failed.@Dukestar69 on GitHub · 2026-11-26 08:50 UTC · original · approved these changes
Verified on RTX 5090 & WARP against
origin/main(63bcca4):cargo test -p victory-shader --lib emit::stride_tests:: -- --test-threads=1:a_flat_sampler_phi_selects_among_three_static_samplers,a_nested_sampler_phi_selects_regular_and_comparison_samplers,a_sampler_chosen_by_a_uniform_branch_samples_as_chosen) passed on both RTX 5090 and WARP.VICTORY_WARP=1; on RTX 5090, the only 2 failures (a_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zeros) reproduce identically on cleanorigin/main.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly generalizes immediate sampler phis to multi-way and nested phis across both regular and comparison samplers.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.