RFC: Opt-in DX12 Async Compute BCPack (All 6 Formats: BC1/BC3/BC4/BC5/BC6H/BC7) + NVIDIA Descriptor Paging via bcpack-gpu-sdk v0.13.0 #1199
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork#1199
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:44 UTC · original
Hi
fxceless/victory-forkmaintainers,I would like to propose integrating
bcpack-gpu-sdk(v0.13.0,MIT OR Apache-2.0) to offload DirectStorage BCPack decompression from the CPU to GPU Async Compute across all 6 BCPack formats (BC1,BC3,BC4,BC5,BC6HModes 1–14,BC7Modes 0–7), and also discuss a complementary NVIDIA descriptor paging follow-up forvictory-gpu.Why this helps
victory-forkcrates/victory-hle/src/modules/dstorage.rs:968decodes every BCPack request on the CPU viabcpack::decode(bc, &source, out, tables).rANS) + block rebuild onto D3D12 Async Compute removes CPU decompression cost while keeping the path completely opt-in and bit-exact againstvictory_formats::bcpack::decode.Phase 1: Ready & Verified Prototype Today
I tested an opt-in prototype patch against
fxceless/victory-forkcommit32b31f7usingbcpack-gpu-sdkv0.13.0:--features gpu-bcpackandVICTORY_GPU_BCPACK=1(zero impact on default builds or default runtime behavior).MIT OR Apache-2.0):bcpack-gpu-sdkships compiled DXIL + Vulkan 1.3 SPIR-V compute kernels only, without embedding proprietary tables;victory-hlefeeds BCPack reference tables (TABLES_BIN) at runtime viabcpack_gpu_set_{bc1,bc6h,bc7}_tables(or falls back cleanly to CPUbcpack::decodewhen unavailable).cargo check -p victory-hle -p victory --features gpu-bcpack-> exit0(0 warnings invictory-hleandvictory).cargo test --release -p victory-hle --features gpu-bcpack gpu_bcpack_matches_victory_cpu -- --nocapture->test result: ok. 1 passed; 0 failed(TEST_RC=0):0 byte mismatchesvsvictory_formats::bcpack::decode) across all 6 formats (BC1,BC3,BC4,BC5,BC6H,BC7) × both[no-ref]and[full-ref+dict]modes.Note: Phase 1 uses
BcPackDecodeAsyncincrates/victory-hle/src/modules/dstorage.rs:968and still copies decoded BC blocks back intooutso existingdstorage/victory-gpucontracts stay unchanged.Proposed Follow-Ups
victory-gpu(bcpack_gpu_create_from_device+BcPackDecodeToTexture2D):Attach directly to
victory-gpu'sID3D12Device/ Async Compute queue and decode straight into GPU resources / staging textures via fence sync, eliminating the CPU readback hop indstorage.rs(also relevant for staging concurrency such as #1157).VirtualDescriptorPager) incrates/victory-gpu/src/descriptor/host.rs:Right now
crates/victory-gpu/src/descriptor/host.rs:795setsconst PORTABLE_VIEWS: u32 = 1_000_000;, constrained by NVIDIA's ~1MCBV_SRV_UAVD3D12 hardware heap limit (whereas AMD/console workloads assume larger flat view heaps). A lightweightVirtualDescriptorPagermapping virtual guest descriptor indices into a 1M physical pool (with LRU eviction +victory-shaderindirection or on-demand fault/rebind) could help NVIDIA stability without breaking AMD's direct indexing.bcpack-gpu-sdk v0.13.0also ships 14 Vulkan 1.3 SPIR-V compute kernels alongside DXIL if a Vulkan/Linux compute path is ever useful.Questions for Maintainers
gpu-bcpackfeature (using the release crate or prebuiltbcpack_gpu.dllfromv0.13.0), and do you prefer keeping CPUbcpack::decodereadback compatibility first or moving straight to zero-copy hooks invictory-gpu?PORTABLE_VIEWS = 1_000_000limit incrates/victory-gpu/src/descriptor/host.rs:795before I prototype aVirtualDescriptorPageragainstfxceless/victory-fork?@POMXARK on GitHub · 2026-11-26 00:50 UTC · original
Follow-up on item 2 above (
PORTABLE_VIEWS = 1_000_000):I put together an opt-in (
VICTORY_VIEW_PAGER=1)VirtualDescriptorPager+SLOT_VIEW_MAP(t252) prototype againstmain(006c353) and verified it on Windows 11 (NVIDIA RTX 5080):victory-shaderandvictory-gpu, off by default)victory-shader: addsSLOT_VIEW_MAP(t252inROOT_CBV_SPACE,1 << 21dwords),set_view_heap_paged/view_heap_paged(included intranslation_fingerprint()), and remaps onlyRootType::ResourceHeapview-heap indices inemit/lower.rs(heap_index,fetched_index).SLOT_STRIDESstays indexed by virtual slot, whileRootType::Table,SamplerHeap, andUSER_MEMORY_BASEremain untouched.victory-gpu: addsdescriptor/pager.rs(VirtualDescriptorPagerwith clock second-chance eviction), partitions a capped heap into[0..direct),[direct..dynamic_base),DYNAMIC([dynamic_base..null_slot)), andnull_slot = 999_999, allocates the 8 MiBview_mapupload buffer inHostHeap, routesmirror/mirror_copied/mirror_copied_page/texture_slot_made_frompastcount, and bindst252inpipeline/host.rsanddraw.rs.cargo check --workspace-> exit0(0 new warnings)cargo test -p victory-shader->218 passed; 0 failed; 3 ignored, includingdxil.dll-validatedemit::lower::tests::paged_resource_heap_emits_valid_dxil_with_view_map_srvcargo test -p victory-gpu descriptor::->33 passed; 0 failed, including 3descriptor::pager::testsunit tests and real D3D12descriptor::host::tests::paged_host_heap_maps_slots_past_portable_views_on_d3d12(mapping virtual slots800_000,1_200_000, and1_507_328..1_507_330into aPORTABLE_VIEWSheap with eviction reset to999_999and disjointDYNAMICslots).