perf(gpu): VRAM DEFAULT sampled-slot marks with async present readback, WaveIsFirstLane dedup, and shader cache key fix #1425
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by adwen-007 on 2026-11-28T19:40:12Z.
Summary
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):