RFC: Opt-in DX12 Async Compute BCPack (All 6 Formats: BC1/BC3/BC4/BC5/BC6H/BC7) + AMD Gfx10 Detile via bcpack-gpu-sdk v0.13.0 #15
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#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@POMXARK on GitHub · 2026-11-25 23:34 UTC · original
Hi! We built
POMXARK/bcpack-gpu-sdk(v0.13.0, dual-licensedMIT OR Apache-2.0, clean-room HLSL SM 6.6 + DXIL + Vulkan 1.3 SPIR-V, compatible withVIctory'sGPL-3.0-or-later) and verified a minimal opt-in prototype patch hookingvictory-hle/src/modules/dstorage.rsacross all 6 BCPack formats (BC1,BC3,BC4,BC5,BC6H,BC7).--features gpu-bcpack): https://gist.github.com/POMXARK/f72b3f0f503f63e57cf54c3240f8c5f6v0.13.0): https://github.com/POMXARK/bcpack-gpu-sdk/releases/tag/v0.13.0 (bcpack_gpu.dll,bcpack_gpu.dll.lib,bcpack_gpu.h)1. Where This Helps (and Where It Does Not)
bcpack_gpu::ffi::BcPackDecodeAsync), freeing CPU cores during heavy texture streaming and helping reduce late texture pop-in in city chases.64KB_D/4KB_Scompute detiler (gfx10_detile.hlsl) and an SM 6.6ResourceDescriptorHeap[]virtual pager (VirtualDescriptorPager,bindless_paging.hlsl) relevant to NVIDIA'sPORTABLE_VIEWS = 1_000_000descriptor heap ceiling.48 mssingle-threadprepare/36k–67kdraw-call CPU bottleneck orcard(41 ms) submission time.XboxBvhBuilder.dll/ native 64B & 128B BVH nodes; there is no DXR API call to intercept).2. Verified Bit-Exact Parity Against
victory_formats::bcpack::decode(12/12 PASS)Tested via
victory_hle::modules::dstorage::gpu_bcpack::tests::gpu_bcpack_matches_victory_cpuagainstPOMXARK/bcpack-gpu-sdktagv0.13.0(7b79cbd) on Windows 11 + NVIDIA RTX 5080 (cargo test --release -p victory-hle --features gpu-bcpack gpu_bcpack_matches_victory_cpu -- --nocapture,TEST_RC=0,1 passed; 0 failed,0warnings invictory-hle,victory, andbcpack-gpu-sdk):victory_formats::bcpack::decode32 KiB,4096blocks)no-ref&full-ref+dictrank1,ep_ref,ix_ref, 255-entry dict, 256-hist32 KiB,2048blocks)no-ref&full-ref+dict32 KiB,4096blocks)no-ref&full-ref+dict32 KiB,2048blocks)no-ref&full-ref+dict32 KiB,2048blocks)no-ref&full-ref+dict32 KiB,2048blocks)no-ref&full-ref+dictctrl7, 255-entry dict, 256-hist3. Phase 1: Ready & Verified Today (
--features gpu-bcpack+VICTORY_GPU_BCPACK=1)--features gpu-bcpack(Cargo.toml,crates/victory-hle/Cargo.toml,apps/victory/Cargo.toml). Default builds omitbcpack-gpu-sdkcompletely (0changes to default dependencies).VICTORY_GPU_BCPACK=1(off by default) andVICTORY_GPU_BCPACK_MIN_KB(default32KiB).crates/victory-hle/src/modules/dstorage.rs): insideinto_destination(request, size, |out| ...)viaBcPackDecodeAsyncjust beforebcpack::decode(...). Preserves full guest memory compatibility (safe when guest CPU reads back decoded buffers) with transparent fallback tovictory_formats::bcpack::decodeon disabled/small chunks (< VICTORY_GPU_BCPACK_MIN_KB, verified in test) or adapter errors.4. Proposed Next Steps (Phase 2 & NVIDIA Support — Seeking Feedback First)
ID3D12Devicepath (victory-gpu/VICTORY_LAND):bcpack_gpu_create_from_devicedirectly tovictory-gpu'sID3D12Device/ID3D12CommandQueueand route VRAM-bound textures (VICTORY_LAND/ copy queue) throughBcPackDecodeToBuffer/BcPackDecodeToTexture2D+ inlinegfx10_detile, eliminating CPU readback for texture streaming while keepingBcPackDecodeAsyncfor CPU-readable guest buffers.PORTABLE_VIEWS = 1_000_000vs2^22withRAW_TWINS = 1 << 21):crates/victory-gpu/src/descriptor/host.rs),probe_view_limit()sees thePORTABLE_VIEWS = 1_000_000cap and clamps retail views>= 1,000,000to the null slot, whereasUNCAPPED_VIEWS+RAW_TWINS(1 << 21) expects a2^22-slot heap.2^22-slot non-shader-visible staging descriptor heap indescriptor/host.rswith dynamicVirtualDescriptorPager(g_VirtToPhys[]) indirection invictory-shader(ResourceDescriptorHeap[g_VirtToPhys[idx]], preservingRAW_TWINSpairs) to run cleanly within NVIDIA's< 1Mshader-visible limit.Questions before opening a PR / touching
victory-shader:bcpack-gpu-sdk(MIT OR Apache-2.0) dependency behind--features gpu-bcpack?crates/victory-gpu/src/descriptor/host.rsorvictory-shaderbefore we prototype and benchmark the NVIDIA descriptor pager on RTX 5080?@lorddie on GitHub · 2026-11-26 12:54 UTC · original
+1 from an RX 9070 XT + Ryzen 5 5600X (6 cores) machine; I would gladly test this.
On this machine the frame is set by the CPU, not the card. In my runs on Belobug's fork (about 152 ms a frame, about 6.6 fps), the breakdown per frame was:
The card was busy only 20–60% of the time. In action scenes the copy-back alone rose to 120–220 ms, and the frame rate fell to 0.5–2 fps. Texture streaming is also visibly late here. Moving BCPack decoding and detiling to the card looks like exactly the right trade for a 6-core CPU paired with a fast card.
I don't have much time to develop it myself, but I can build any branch or patch you post, run it on RDNA4, and report frame times, texture lag and stability, compared with the same scene without it.