[Contribution] Clean-Room GPU BCPack Decoder (DX12 Zero-Copy C-ABI + Vulkan 1.3 SPIR-V) & 1.25M Descriptor Paging (MIT/Apache-2.0) #63
Labels
No labels
accessibility
bug
cross-platform
documentation
duplicate
enhancement
gdk-shims
good first issue
graphics
hardware-report
help wanted
invalid
question
shaders
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/californiaAlmonds--OpenScarlett#63
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 19:28 UTC · original
Hi team,
Congrats on the awesome bring-up progress! Since OpenScarlett targets both D3D12 and Vulkan 1.4 (and C++20 runtime shims without a Rust dependency), I wanted to share a clean-room,
MIT OR Apache-2.0licensed GPU BCPack (MDU rANS) decompressor + Virtual Descriptor Pager you can either link directly via C-ABI or embed as HLSL/SPIR-V kernels:v0.10.0): https://github.com/POMXARK/bcpack-gpu-hlsl/releases/tag/v0.10.0 (bcpack-gpu-sdk-v0.10.0-win64.zip)docs/AI_ARCHITECTURE.mdWhat Fits OpenScarlett's D3D12 & Vulkan Pipeline
bcpack_gpu.dll+include/bcpack_gpu.h):ID3D12Device*(+ optional compute queue) tobcpack_gpu_create_from_device(...).BcPackDecodeToBuffer(...)orBcPackDecodeToTexture2D(...)to decode linearBC1/ fused AMD Gfx10SW_64KB_D/SW_4KB_S(432.6 GB/s) / 16-laneBC7rANS directly into caller GPU resources (including auto 256B RowPitch padding for small mips) and wait purely on GPU viadirect_queue->Wait((ID3D12Fence*)BcPackGetDirectFence(ctx), fence).shaders/spirv/*.spv,shaders/compile_spirv.sh):DirectXShaderCompiler v1.9.2609(-spirv -fspv-target-env=vulkan1.3 -T cs_6_6 -E CSMain -O3):bcpack_decode.spv,bcpack_bc7_rans.spv,bc16_pack.spv,gfx10_detile.spv,hiz_build.spv,crowd_skin.spv, andbindless_paging.spv(note: enableVK_EXT_subgroup_size_controlfor Wave32 on 64-wide GPUs).src/descriptor_paging.rs,shaders/bindless_paging.hlsl):shader-visibledescriptor heap limit by paging1,250,000virtual descriptor IDs onto262,144physical slots viaCopyDescriptorsSimplein0.064 ms(0mismatches).19/19 PASS, DX12 Debug Layer clean — 0 errors): 11.33 GB/s BC1 (282× vs 1T CPU) and 6.02 GB/s equiv on 16-lane BC7 rANS (100% Wave32 =32/32lanes), plus DXC-O3WaveActiveBallotworkaround documented inAI_ARCHITECTURE.md.Let me know if you'd like any adjustments for OpenScarlett's CMake/build integration!
@californiaAlmonds on GitHub · 2026-11-26 07:44 UTC · original
Thank you so much @POMXARK for sharing this — a clean-room MIT/Apache-2.0 GPU BCPack (MDU rANS + fused GFX10 detiling) decoder with zero-copy D3D12/Vulkan SPIR-V kernels and a 1.25M virtual descriptor pager is genuinely very useful for OpenScarlett! Both fast GPU-side texture decompression during heavy world streaming and virtual descriptor paging for large bindless heaps fit our roadmap closely. We are wrapping up our current active bring-up tasks right now, and we will begin testing and evaluating integration as soon as those are complete!
@POMXARK on GitHub · 2026-11-26 11:54 UTC · original
Glad to hear it fits the roadmap @californiaAlmonds! Take your time finishing up the bring-up tasks — no rush at all.
Quick heads-up for whenever you're ready to test: I just pushed
bcpack-gpu-sdk v0.14.1(https://github.com/POMXARK/bcpack-gpu-sdk/releases/tag/v0.14.1) with a couple of important updates since the initial release:bcpack_decode.{spv,dxil}): AddedBC1lane 1index-reference prediction matchingbcpack-rs#11, plus restrictedBC7channel rotation strictly to modes4and5(bcpack_bc7_rebuild.{spv,dxil}).BcPackDecodeBatch): Batches heterogeneousBC1/BC3/BC4/BC5/BC6H/BC7chunks by pipeline family with automatic sub-batching (42.7xfaster than looping single-chunkBcPackDecodeAsynccalls on RTX 5080).BcPackDecodeToTexture2Dscaling: Removed the hardcoded16 MiBrow_pad_defaultcap so4K+row-padded subresources scale cleanly with context capacity.Happy to help wire up a small
VK_EXT_subgroup_size_controlor C-ABI smoke hook wheneverOpenScarlettgets to it.