perf(draw): skip Set*Root32BitConstants when the host list already holds those user-data dwords under the same root signature #642
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!642
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-642"
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?
@Raptorbk45 on GitHub · 2026-12-05 22:37 UTC · original
Raptorbk45:perf/skip-same-root-constants→main· +39 −6 · 1 files · 1 commits · openEvery bind calls
SetGraphicsRoot32BitConstants/SetComputeRoot32BitConstantswith the user data of each stage, even when the list already holds exactly those dwords for that parameter. In vkd3d-proton that marks the root constants dirty and pushes them again at the next draw.Statenow keeps, per pipeline kind, the dwords last set per root parameter (user_sent) and skips the call when they are equal. Everything that computesvalues(root_word,host_word, material records, the diagnostics copy) still runs; only the D3D12 call is skipped.Invalidation: root arguments are undefined after the root signature of that kind is set again, so
user_sent[kind]is cleared exactly wherebindcallsSet{Graphics,Compute}RootSignature(thehost_rootsbranch) and after the ambientScreenHitsreflection path re-sets the compute root signature. Every other place that clobbers the list's root state (external_compute,replay, the ambient/lightprobe/indirect batch/window paths) already zeroeshost_roots, which forces that branch and therefore the clear;State::resetstarts fromDefault. So a skip can only happen when no root signature of that kind was set on the list since the dwords were set.How it was checked
Run after the final edit, on Linux (CachyOS), against
mainat8c4e6633:./build.sh check(release, MSVC target): passes; the one warning (room_latelynever used,resource.rs) is already onmaincargo xtask policy: passesPROFILE=diag ./build.sh check: passesNot run: the game, on this branch. A version of this change ran on our fork in play since 1 December 2026 without a broken image we could tie to it; that is not a test.
Branch head:
0ed70339.Not measured on its own: it removes D3D12 calls and push-constant uploads for repeated user data, which our profiling of the translating threads (our fork, December 2026) showed among the per-draw costs, but we have no A/B of this change alone. No unit test: it needs a host command list; correctness rests on the invalidation argument above, please check it against any path I missed.
Checks
draw.rscargo xtask policyView 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.