GPU: mesh pipelines load from the pipeline library (name their topology) #352
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!352
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/352/head"
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?
@rhuantac on GitHub · 2026-11-24 02:30 UTC · original
rhuantac:fix/mesh-pipelines-load-from-library→main· +101 −2 · 1 files · 1 commits · closed without mergingA mesh pipeline never loaded from the host pipeline library:
LoadPipelinerefused it withE_INVALIDARG(debug layer 972, "does not match the one used to create the PSO") even with the very stream it was made from, so every mesh pipeline was compiled again on every run and its store then refused (970, "already exists") — the 972/970 pair in #264 (item 3; #334 covers its items 1 and 2).Measured with synthetic pipelines on an RTX 3060 Ti, Windows 11 26300, with and without the debug layer: compute, graphics (DXBC and DXIL) and VS/PS streams load; a mesh stream loads only with a
PRIMITIVE_TOPOLOGYsubobject that is notUNDEFINED. The debug layer wants it to match the mesh shader's output topology (1323), and our translation makes triangle mesh shaders only (mesh_prologue), so the stream now namesTRIANGLE. Mesh pipelines get a new library name ("mesh triangles"), so entries stored without a topology are not looked up again.Test:
a_mesh_pipeline_loads_from_the_librarymakes a mesh pipeline twice throughmesh_pipelineand requires the second to come from the library; it fails before this change and passes after (skipped without a PCdxc.exe).cargo test -p victory-gpu: 44 passed, 1 ignored. Not measured: the effect on the title's loading time.AI use: Claude Code ran the experiments and wrote the change; I reviewed it.
🤖 Generated with Claude Code
@ifBars on GitHub · 2026-11-24 02:42 UTC · original
I reproduced the cache miss on Windows 10 with Agility SDK 620 and the WARP software adapter. I ran the same synthetic triangle mesh pipeline through Causeway's mesh-pipeline creation path 21 times, saved the library, then reopened it in a new process. Without the topology, the reopened library served 0/21 calls. With the triangle topology and the new cache key, it served all 21. On an empty cache the changed build compiled the first pipeline and loaded the next 20.
Our last story trace includes successful mesh pipeline creations, but it only reports aggregate library hits. These results establish the cache behavior. The effect on story loading time and FPS remains unmeasured.
@fuzeofficlal on GitHub · 2026-11-24 11:20 UTC · original
I verified the on-disk pipeline library on exact head
f77bd28with a physical RTX 5090 (driver 616.56) and Windows build 26200. Both processes used VIctory's productionHostPipeline::newpath with the same synthetic triangle mesh shader and a separate VS/PS control.The processes used the same GPU LUID and the same 3,512-byte library. The cold run had two expected name-not-found messages (971). The reopen run had no D3D12 diagnostics. This measures reuse of the synthetic PSOs across process launches.
@qntic on GitHub · 2026-11-24 13:26 UTC · original
another data point from amd, rx 6600 xt with driver 32.0.21045.5002.
a_mesh_pipeline_loads_from_the_library passes both with this pr and after removing the topology subobject entirely.
setting it to D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED instead causes E_INVALIDARG.
looks like the original issue may be driver-specific. the fix itself works fine on my card too.
@rhuantac on GitHub · 2026-11-24 15:22 UTC · original
In-title check of this PR, on an RTX 3060 Ti (driver 610.88, Windows 11) with retail 1.0.2.1. Details are in #732.
test/world-stack(e0c3385) with and without this PR (f77bd28, merges cleanly),diagwithVICTORY_D3D12_DEBUG=1, two runs per tree from a new empty cache, about 2 min of the intro cutscene each:No id=1323 with the PR. Not measured: the effect on loading time.
AI-assisted (Claude Code); the numbers are counted from the logs.
@bittertea0323 on GitHub · 2026-11-24 15:56 UTC · original
Real-title confirmation:
madegoes 512 → 72 → 1Your fix does more than the synthetic case in #780. Measured on a 4070 SUPER, Windows 10, Series X,
try/wave64(i.e. #189 + #940 + #729 + #737 + this) +VICTORY_WAVE64_EMULATE=emulate+VICTORY_TEXTURE_MIP_DROP=1, diag build, 240 s per run:made)The first run alone confirms your diagnosis: mesh PSOs that never loaded before start loading, so the
rebuild count drops by 86 % on a cold library. What the later run shows is that the rest was only
cold-miss too — once the library holds the entries, exactly one pipeline still needs compiling, and
1272 load.
Knock-on effects that matter more than the counter:
the title compiling a batch that your fix now loads).
building … (N being made)during the world dropped from 167–243 to 122–165, and the frame budgetfinally stopped being dominated by compilation.
before it died at 93 s on a 13.3 s submission.
Not measured: whether
made=1needs a second warm run on other hardware, and which single pipeline itis (we did not enable
VICTORY_D3D12_DEBUG=1to get its name). If you want that name I can run oncewith the debug layer on.
@Yaekai on GitHub · 2026-11-24 16:19 UTC · original
Independent verification on Windows 11 + NVIDIA RTX 3070 (Rust 1.98.1) at head
f77bd28:cargo test -p victory-gpu --lib: 44 passed, 0 failed (includinga_mesh_pipeline_loads_from_the_library).cargo clippy -p victory-gpu -- -D warnings: 0 warnings.1.0.2.1,--console series-s): confirmed mesh pipelines save to and reload cleanly from the host pipeline library (loaded=2102on warm restart). Ready to merge!@Bullet18x on GitHub · 2026-11-24 19:48 UTC · original
RTX 5090 A/B of the pipeline-library messages: this PR vs #1041 vs plain
main, same machine, same protocol.Machine: RTX 5090 32 GB, driver 621.40 (32.0.16.2114), Ryzen 9 9950X3D, 64 GB, Windows 11 Pro 10.0.28000 (in-box D3D12 10.0.28000.3365, Graphics Tools installed).
Builds: each PR's single commit applied on
mainffe310e(f77bd28for this PR,4111946for #1041; each applies cleanly alone, the two conflict inpipeline/host.rs),cargo build --profile diag -p victory --features diagnostics.Protocol per build: empty pipeline library (
host-pipelines.binandearly-pipelines.txtremoved, shader translations kept), run 1 to fill it, then run 2 withVICTORY_D3D12_DEBUG=1; debug-layer messages counted in run 2. Both runs:VICTORY_KEYS=8:Enter,20:Enter,35:Enter,VICTORY_D3D12_DRED=1,victory.exe run <dump>\game_scarlett_master.exe --execute.mainffe310eDXGI_ERROR_DEVICE_HUNGin the world, the first runs after 153 / 84 / 88 s), so it is not comparable between rows.Not tested: AMD / Intel, more than one run per build, the two PRs together (they conflict).
No game data, title-content log lines or screenshots attached. AI use: Claude Code (Claude Opus 5.5) built, ran and counted the messages; I checked the results.
Pull request closed