Skip to content

The empty pipeline library asks for a null blob: vkd3d-proton refuses a pointer at nothing - #119

Merged
pablogonz12 merged 1 commit into
mainfrom
fix/library-blob-wine
Nov 25, 2026
Merged

pablogonz12 merged 1 commit into
mainfrom
fix/library-blob-wine

Conversation

@pablogonz12

@pablogonz12 pablogonz12 commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

What

ID3D12Device1::CreatePipelineLibrary with no bytes was called through windows-rs' &[u8] binding, which
passes a non-null pointer (Rust's empty-slice pointer) and a length of 0. Windows D3D12 accepts that as "make
an empty library"; vkd3d-proton rejects it with E_INVALIDARG, because d3d12_pipeline_library_init has

if (!blob_length && blob)
    return E_INVALIDARG;

(libs/vkd3d/cache.c; its own internal empty library is created with d3d12_pipeline_library_create(device, NULL, 0, ...)).

Since vkd3d-proton is the host of every run we ship, open() fell through to None on the first run of a
title, so the pipeline cache never existed: no StorePipeline, no host-pipelines.bin, no early list — the whole
pipeline-library feature was dead under Proton while CI (windows-latest, WARP) stayed green because real D3D12
takes both forms.

create() now calls the interface's vtable entry directly with a null blob when there are no bytes (and the
bytes' own pointer otherwise), which both Windows and vkd3d-proton accept, and takes ownership of the returned
reference with Interface::from_raw. Everything else (open's rejection path, the mapped-file bookkeeping) is
unchanged.

The test a_rejected_blob_gives_an_empty_library now asserts the behaviour we rely on in both cases: no blob at
all (first run) and a blob the host rejects both give a library with a serialisable size and Blob::None kept.
The first case is exactly what failed; it was the one case no test covered.

Not a test assumption

The failure was a real behaviour difference under vkd3d-proton (above), not a test assumption: the difference is
in the argument, and the code now sends the argument both hosts take. No env switch: the old call is not a
behaviour anyone can want back, and there is nothing to compare against.

Gates

  • cargo xwin clippy --target x86_64-pc-windows-msvc --workspace --all-targets -- -D warnings: clean.
  • victory-gpu test exe under Wine + GE-Proton11-14, native vkd3d-proton (WINEDLLOVERRIDES="d3d12,d3d12core=n"),
    --test-threads=1: 155 passed, 0 failed, 1 ignored (before the fix the same run: 1 failed — the empty
    library 0x80070057 E_INVALIDARG, open → None).
  • The fixed test alone, --exact pipeline::library::tests::a_rejected_blob_gives_an_empty_library --nocapture: ok.
  • CI (windows-latest / WARP) below.

Not tested in a game run.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of empty or rejected pipeline library data. An empty library can now be created as a fallback and serialized with a nonzero size.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Pipeline library creation

Layer / File(s) Summary
Create and open pipeline libraries
crates/victory-gpu/src/pipeline/library.rs
The new helper passes a null pointer for an empty blob and the byte-slice pointer and length for nonempty blobs. It propagates creation errors and casts the returned interface. open uses the helper for saved blobs and the empty fallback. The test checks that opening an empty blob creates a library with a nonzero serialized size and retains Blob::None.

Possibly related PRs

  • pablogonz12/Scarlight#15: Its summary also lists a null pipeline-library blob, which overlaps with this PR’s empty-blob behavior.
  • pablogonz12/Scarlight#86: It reports a Wine test failure in the empty-library path that this PR changes, although its own title-buffer changes are independent.

Suggested reviewers: fever308, fxceless

Change: Bug fix

Merge Risk: Minimal · up to edcf2

This fixes empty pipeline library creation on vkd3d-proton by passing a null blob pointer. The nonempty path is unchanged and the reported tests passed, so I see no meaningful merge risk. A game run was not tested.

Architecture risk: Medium · up to edcf2

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/victory-gpu/src/pipeline/library.rs: Added create, which calls the device interface directly and uses a null pointer for an empty blob instead of relying on the wrapper’s empty-slice representation; nonempty blobs are passed by pointer and length. The helper propagates call errors and casts the returned interface. open now delegates library creation to this helper for both saved and empty blobs.
  • observed — Modified behavior in crates/victory-gpu/src/pipeline/library.rs: open now binds its creation closure to the new create helper; the prior inline wrapper call and its local safety comment were removed.
  • observed — Modified behavior in crates/victory-gpu/src/pipeline/library.rs: Added a test case for opening Blob::None, asserting that an empty library is created, has a nonzero serialized size, and retains Blob::None. The existing rejected-blob case continues after this new case.

Reliability and maintainability

  • inferred — Risk-relevant change factors for crates: blast_radius_1; blast_radius_2; direct_dependents_1
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a649e9c4-a48b-4f78-9e27-8c38b623d9df
Commits

Reviewing files that changed from the base of the PR and between 51caf20 and edcf249.

Files selected for processing: 1

  • crates/victory-gpu/src/pipeline/library.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@pablogonz12
pablogonz12 merged commit 748f3b3 into main Nov 25, 2026
3 checks passed
pablogonz12 added a commit that referenced this pull request Nov 25, 2026
Main moved with #114, #119 and #126. Three conflicts:

- `CREDITS.md`: both sides kept — fxceless's fork, Wasler's fork (the
  interval, the gap-coalesced rehash, the integer blend bypass) and
  vitutu1/ZigZagBoi1 beside JMAN730/victory's `project-flamingo#672`.
- `descriptor/host.rs` and `texture.rs`: main's narrowed-SRV work (#672,
  #126) stands on the present-order machinery and the live `switches`
  module this line does not carry (`Order`, `Present`,
  `crate::switches::b`, `copystat::C::ViewNarrowed`, `Staging::present`),
  so the two files stay this line's. Porting that work is its own change,
  not something a merge resolution can decide. `HostHeap::copied`, this
  line's record fingerprint, is kept.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant