gpu(pipeline): pass NULL blob pointer on empty pipeline library creation #133
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Androtim--MiniVI!133
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/133/head"
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?
@Androtim on GitHub · 2026-11-29 14:24 UTC · original
Androtim:feat/iter134-pipeline-library-null-empty-blob→main· +31 −1 · 1 files · 1 commits · merged 2026-11-29 16:18 UTCSummary
Fixes empty pipeline-library creation in
crates/victory-gpu/src/pipeline/library.rsunder strict D3D12 / vkd3d-proton validators:null_when_empty(bytes: &[u8]) -> *const std::ffi::c_voidso zero-length slices map tostd::ptr::null().ID3D12Device1::CreatePipelineLibraryvia its vtable inopen()so empty blobs pass(NULL, 0)instead of a Rust empty-slice non-null address.empty_blob_uses_null_pointer.Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy(303 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- pipeline::library::(9 passed; 0 failed)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings(0 warnings)cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics --locked -- -D warnings(0 warnings)@Androtim on GitHub · 2026-11-29 15:02 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
Clean, minimal fix in
crates/victory-gpu/src/pipeline/library.rsfor empty pipeline library creation under strict D3D12 / vkd3d-proton validators.&[]) have a non-null dangling pointer, whichwindows-rs'sID3D12Device1::CreatePipelineLibrarywrapper forwards alongsideBlobLength == 0. Addingnull_when_empty(bytes)and invokingInterface::vtable(device).CreatePipelineLibrarydirectly inopen()ensures(NULL, 0)is passed when creating an empty library while preserving the existing slice pointer and length for non-empty blobs.ID3D12Device1::CreatePipelineLibrary(as_raw(device),pointer,bytes.len(),&ID3D12PipelineLibrary::IID,(&raw mut library).cast()), checks the returnedHRESULTvia.ok()?, guards against a null out-pointer withE_POINTER, and casts toID3D12PipelineLibrary1. Non-empty blob lifetimes remain tied toLibrary._blob.empty_blob_uses_null_pointercovers both empty and non-empty slices, and CI is passing.Because this replaces a
windows-rswrapper with a direct D3D12 host COM vtable call inopen(), a quick real-GPU smoke test (both cold start with nohost-pipelines.binand warm start with an existing library) is recommended before merging.Generated with Antigravity CLI (
agy).@Androtim on GitHub · 2026-11-29 15:50 UTC · original
Verified PR #133 with both cold (empty library) and warm (existing library) Series S GPU smoke tests (
--release --features diagnostics,-AutoNudgeMenu) viascripts/verify-world.ps1using an isolatedVICTORY_LIBRARY_DIR:D:\victory-data\verify-runs\pr133-library-cold, 45s in-world) — 6/6 PASS:stderr.log:no host pipeline library yet; starting an empty one-> created and grewhost-pipelines.binto28,997,028bytes cleanly with zero D3D12 COM errors.78s(world_windows=11,max_draws=11556),12.2 fps,crashes=0,no_host_texture_errors=0,used_max=5547 MB(over=0 MB), visually inspectedframe-11799.pngandframe-11807.png.D:\victory-data\verify-runs\pr133-library-warm, 35s in-world reusing generated library) — 6/6 PASS:stderr.log:host pipeline library loaded bytes=28997028 mapped=true->host pipeline library saved bytes=29021842 early=4294 made=1750 loaded=1629 started_early=3380.77s(world_windows=9,max_draws=11272),12.4 fps,crashes=0,no_host_texture_errors=0,used_max=5609 MB(over=0 MB), visually inspectedframe-11706.pngandframe-11714.png.