Renderer port 5: table constant buffers in host copies read through their raw twin (VICTORY_PORT_CBV_COPIES=1) #363
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!363
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-363"
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?
@Sr-0w on GitHub · 2026-11-26 19:04 UTC · original
port/cbv-copies→main· +164 −26 · 4 files · 1 commits · closed without mergingSummary
Extends renderer port #5 (
VICTORY_PORT_CBV=1) behind a new opt-in switchVICTORY_PORT_CBV_COPIES=1(off by default, A/B-able viaVICTORY_AB):draw.rsonly viewed table constant buffers (View::Constant) directly through their raw twin when theirShadowwasin_place(). Constant buffers in ordinary host copies (~760–810/frame, ~2 MB/frame) fell back toStep::Fillthrough per-list scratch upload memory.Step::Fillreads GPU-written memory,card_stepseither emits a bounce copy (~100–137 fills/frame, ~1.4 ms/frame planning) or — whenever aStep::Placedcopy touches that range (BEHIND_PLACED) — drains the GPU queue with a full flight wait (WHY_READ).VICTORY_PORT_CBV_COPIES=1(requiringVICTORY_PORT_CBV=1), 16-byte-aligned table constant buffers in non-in-place host copies are viewed directly throughHostHeap::constant_raw_atand brought up to date viashadow.refresh(list, address, size), matching title slots and root views. Unaligned or unshadowed constant buffers keep the existingStep::Fillfallback.in host copies, KB) inport_cbv::log, CPU unit tests for switch parsing andtable_useselection, andREADME.mddocumentation.Assumption
Constants are written by the title into rings it waits on with fences before reusing, and a host copy is refreshed like any other title buffer: CPU writes before submission go up through
Shadow::refresh(withVICTORY_SEND_OWN=1uploading dirty runs in queue order for card-side copies), while prior shader writes and placed buffer copies are read directly from the host copy on the card in command-list order.Measurements
Hardware & configuration: RX 7800 XT 16 GB, Series X profile, ray tracing on (
VICTORY_BVH_BUILDER=1), renderer ports 1, 2, 5, 6 and 7 on, warm cache, water scene in a retail game.Standalone A/B (
VICTORY_AB=15,VICTORY_PORT_CBV_COPIES, last six steady phases)VICTORY_PORT_CBV_COPIES=0VICTORY_PORT_CBV_COPIES=1card_stepsfills (plan)Combined with companion BVH arena write tracking (last 90 s)
card_stepsfills (plan)VICTORY_PORT_CBV_COPIES=1+ BVH arena tracking)Picture on the water scene unchanged (checked visually on the recorded runs).
Testing
cargo test --locked -p victory-gpu --lib port_cbv: 3 passed, 0 failed.cargo test --locked -p victory-gpu --features diagnostics --lib port_cbv: 3 passed, 0 failed.cargo clippy --locked -p victory-gpu --features diagnostics --lib: 0 warnings in touched files (only main's pre-existing warning inwatch.rs:3626).VICTORY_AB=15,VICTORY_PORT_CBV_COPIESand the combined run above.🤖 Generated with Claude Code
Pull request closed