GPU: deduplicate host ID3D12RootSignatures and cache OPTIONS19 #891
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!891
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-891"
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?
@Starchaser1024 on GitHub · 2026-11-28 08:38 UTC · original
Starchaser1024:perf/deduplicate-root-signatures→main· +1463 −26 · 4 files · 1 commits · closed without mergingSummary
Deduplicates
ID3D12RootSignatureCOM objects and serialized root-signature blobs acrossHostPipelines, cachesD3D12_FEATURE_D3D12_OPTIONS19(AnisoFilterWithPointMipSupported) per device, and deduplicates shared root-signature retention inHostList::bind_pipeline.Cause
HostPipeline::new(crates/victory-gpu/src/pipeline/host.rs) queriedCheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS19), calledD3D12SerializeVersionedRootSignature, and calleddevice.CreateRootSignatureunconditionally for every graphics, mesh, and compute PSO (~2,700–88,600 PSOs sharing a small set of unique root layouts).victory warm(known::make), where eachHostPipelineis dropped immediately after compilation,D3D12Core.dllcannot reuse liveID3D12RootSignaturehandles across PSOs, destroying and recreating driver root signatures on every PSO.ID3D12RootSignaturepointers defeatedState::host_roots(draw.rs:1932-1943) on PSO switches and pushed duplicateID3D12RootSignatureCOM clones intoHostList::deferred.kept(HostList::bind_pipeline).Changes
pipeline::samplers::aniso_point_mip(crates/victory-gpu/src/pipeline/samplers.rs): expose a device-safeOPTIONS19cache (OnceLockfast path for the primaryHostdevice +RwLock<Vec<...>>fallback retaining aID3D12DeviceCOM reference so raw device pointers cannot suffer ABA reuse across standalone/WARP test devices) and reuse it inHostPipeline::new.pipeline::host::root_signature(crates/victory-gpu/src/pipeline/host.rs): cache(ID3D12RootSignature, Arc<[u8]>)inROOT_SIGNATURES(VICTORY_ROOT_CACHE, default1,=0bypasses) using a stack-inlineRootSigKeyBuf([u32; 256]inline + spill) encoding(device_raw, flags, params, static_samplers)losslessly (bit-exactf32::to_bitson LOD fields), skipping bothD3D12SerializeVersionedRootSignatureandCreateRootSignatureon hits while preserving byte-identicalID3D12PipelineLibrarynames.HostList::bind_pipeline(crates/victory-gpu/src/host.rs): deduplicateroot.as_raw() as usizeindeferred.boundbefore cloning intodeferred.kept.Benchmark & Verification (RTX 5060 Ti 16 GB, Windows 11,
--release)pipeline::host::tests::benchmark_500_host_pipeline_root_signatures(500 PSOs across 25 realistic root layouts, 9 rounds):VICTORY_ROOT_CACHE=0(victory warmdrop-each mode)VICTORY_ROOT_CACHE=0(live keep-alive mode)2.37xVICTORY_ROOT_CACHE=1(cold batch: 25 misses + 475 hits)victory warm(5.41xvs keep-alive)VICTORY_ROOT_CACHE=1(warm batch: 500 hits)victory warm(14.2xvs keep-alive)pipeline::host::tests::shared_root_signatures_load_from_library_and_execute_across_pso_switches: verified underVICTORY_D3D12_DEBUG=1(0ID3D12InfoQueuemessages,ID3D12PipelineLibrarystore + reload,SetComputeRootSignatureandSetGraphicsRootSignaturecalled 1 time instead of 3 acrosspso1 -> pso2 -> pso1, exact GPU UAV and RTV readback).cargo test -p victory-gpu --locked: 457 passed, 0 failed.cargo clippy --workspace --all-targets --all-features --locked: 0 warnings in changed files.cargo xtask policy: 294 files ok.GPU: deduplicate host ID3D12RootSignatures and cache OPTIONS19to [pr-performance][rendering][NVIDIA] GPU: deduplicate host ID3D12RootSignatures and cache OPTIONS19a641a14d95to815f58ced5[pr-performance][rendering][NVIDIA] GPU: deduplicate host ID3D12RootSignatures and cache OPTIONS19to GPU: deduplicate host ID3D12RootSignatures and cache OPTIONS19Pull request closed