Shader names: a new container's role is found in one pass, not one per name #3596
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3596
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3596"
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?
@tphira612 on GitHub · 2026-11-30 01:30 UTC · original
perf/shader-name-scan→main· +160 −23 · 2 files · 1 commits · closed without mergingWhat it changes
When the title creates a pipeline with a shader not seen before,
ambient::role(compute) andmirror::part(pixel) look for a few program names in the container. Each name was compared at every byte, one full pass per name: four passes for a compute container, two for a pixel one. This runs on the thread that creates the pipeline, inside the shader table's lock that every other pipeline creation waits on (pipeline::shader).Now one pass looks only where
CS_(orps_) starts and checks the names there. The answers are the same, including which name wins when several are present.This complements #3502, which moves this work out of the lock. Here the work itself gets shorter, on whichever thread runs it.
How it was tested
name_scans_time(new, ignored benchmark), 256 KiB container, Ryzen 9 5900X, release build: compute 1,049 → 85 µs, pixel 317 → 76 µs. A standalone run at 16 KiB: compute 73 → 4 µs. Frame times in the title not measured.names_are_found_as_before(new): both scans give the old answers on 20,000 generated containers with names inserted, overlapping, cut short and at the end. The existingroles_by_nameandparts_by_namepass.cargo test --locked -p victory-gpu --lib: 922 passed. The one failure,every_switch_of_the_translator_is_in_the_key, also fails onmain.cargo build --release --locked -p victoryandcargo xtask policy --stagedpass. Clippy adds no warnings tovictory-gpu(same 27 sites asmain).Pull request closed