perf(gpu): VRAM DEFAULT sampled-slot marks with async present readback, WaveIsFirstLane dedup, and shader cache key fix #1425
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!1425
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1425"
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?
@adwen-007 on GitHub · 2026-11-28 19:40 UTC · original
adwen-007:perf/sampled-marks-vram-wave→main· +247 −163 · 4 files · 1 commits · merged 2026-11-29 08:16 UTCSummary
Implements opt-in shader-sampled bindless texture slot tracking (
VICTORY_SAMPLED_MARKS=1, off by default, building on the slot-marking concept from #1074) in a way that avoids BAR/PCIe GPU stalls on 8 GB GPUs without full-VRAM Resizable BAR, cuts per-wave shader overhead by 32x, and fixes a shader-cacheDXGI_ERROR_DEVICE_HUNGbug when toggling the switch off.Key changes
D3D12_HEAP_TYPE_DEFAULT) + asyncpresentreadback (crates/victory-gpu/src/sampled.rs,host.rs)SLOT_SAMPLED(u251) bitmask strictly in GPU-local GDDR6 VRAM (host.uav_buffer) instead of a CPU-mapped BAR / shared buffer.Host::present_planes, records a singleCopyResourceto a permanently mapped cachedREADBACKbuffer followed by a GPUCopyResourceclear from a zeroUPLOADbuffer, and scans the cached RAM copy onceHost::fence_reachedconfirms completion.WaveIsFirstLane()deduplication (crates/victory-shader/src/emit/lower.rs)(index, per_lane)inheap_indices. For wave-uniform texture handles (!per_lane, the vast majority of bindless texture samples), guardsmark_sampledwithdx.op.waveIsFirstLane(settingflags::WAVE_OPS), reducing shader ALU and L1/L2 traffic by 32x while preserving per-lane marking for divergent waterfall handles.crates/victory-gpu/src/shader_cache.rs)VICTORY_SAMPLED_MARKS=1intoshader_cache::build()so shaders translated with root UAVu251(SLOT_SAMPLED) are never served whenVICTORY_SAMPLED_MARKS=0(otherwisedrawleavesu251unbound and the GPU faults withDXGI_ERROR_DEVICE_HUNG 0x887A0006).HostShaderwhoseroot_uavscontainsSLOT_SAMPLEDwhensampled_marks_on()is false.Testing & Real-Hardware Verification
cargo test -p victory-shader a_picked_texture_marks_its_slot_with_sampled_marks— passed (validates DXIL emission withWaveIsFirstLane+WAVE_OPS).cargo test -p victory-gpu sampled::tests— passed.series-xprofile):b6f4150b5dto7d0c28677f