victory-gpu: guard port 5 table CBVs on hosts without raw twins #643
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/643"
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?
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by Zuwei-Wang on 2026-11-27T16:00:37Z.
Summary
When
VICTORY_PORT_CBV=1is enabled on hosts whose shader-visible view heaps do not support raw twins (e.g. NVIDIA GPUs capped at 1,000,000 views, or runs withVICTORY_RAW_VIEWS=0),victory_shader::emit::raw_views()stays0and translated shaders read table/heap constant buffers from the primary CBV slot (while root constant buffers still run as root SRVs).Previously, three GPU-side paths did not check for raw twins:
descriptor::host::make_twinnedroutedView::Constantthroughconstant_twinned(..., None), which wrote a null CBV into the primary slot for non-256-byte-aligned addresses and returnedSome(...)instead of falling back (None).port_cbv::in_place_on()stayedtrue, causingdraw.rsto runshadow::find()+constant_raw_at()on every table constant buffer each frame only to fail onself.twin(index)and miscount all of them as"not on 16 bytes".probe_view_limit) norport_cbv::logexplained why table CBVs fell back on hosts without raw twins.Changes
crates/victory-gpu/src/port_cbv.rs: gatein_place_on()onhas_raw_twins()(victory_shader::emit::raw_views() != 0), log the fallback clearly inport_cbv::log(), and add unit testtable_in_place_requires_raw_twins.crates/victory-gpu/src/descriptor/host.rs: require a non-optional twin handle inconstant_twinned, fall through to the standard 256-byte-aligned CBV path inmake_constantwhen no twin slot exists, warn once inprobe_view_limitwhenVICTORY_PORT_CBV=1runs without raw twins, and add D3D12 unit testport_cbv_without_twin_rejects_unaligned_constant_buffer.README.md: document the raw-twin requirement for table CBVs underVICTORY_PORT_CBV=1.Testing (Windows 11, Ryzen 7 9800X3D, NVIDIA GeForce RTX 5070 Ti 16 GB)
cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test -p victory-gpu -p xtask --lockedcargo test -p victory-gpu --all-features --locked -- --test-threads=1View 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.