gpu: pass null pointer for empty CreatePipelineLibrary (vkd3d-proton) #31

Manually merged
github merged 1 commit from github-bot/gh-31 into main 2026-11-26 19:44:31 +00:00 AGit
Owner

@⁠nullexxx on GitHub · 2026-11-26 13:37 UTC · original
nullexxx:fix/vkd3d-empty-pipeline-library → main · +14 −1 · 1 files · 1 commits · merged 2026-11-26 19:30 UTC

Summary

When starting without an existing pipeline library, CreatePipelineLibrary(&[]) passes Rust's dangling non-null slice pointer (0x1) with length 0. Windows ignores it, but vkd3d-proton rejects it with E_INVALIDARG (no host pipeline library: pipelines are not kept), preventing pipelines from persisting across runs under Wine/Proton.

This passes std::ptr::null() when bytes.is_empty(), matching upstream Marvisak/VIctory commit e5a8c2f (PR #994). Windows behavior is unchanged.

Testing

  • Cross-compiled with cargo xwin build --target x86_64-pc-windows-msvc --locked --release -p victory on CachyOS (Linux 7.3.6) and run under GE-Proton11-14 (vkd3d-proton 3.2) on an RTX 5080 (620.73.04).
  • Before: WARN victory_gpu::pipeline::library: no host pipeline library: pipelines are not kept
  • After: host pipeline library saved bytes=318968 early=1848 made=7 loaded=1862 started_early=1873, and character models in cutscenes load from cache on subsequent launches.

AI-assisted (Gemini) patch and log analysis; built and verified locally on my own copy.

**@⁠nullexxx** on GitHub · 2026-11-26 13:37 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/31) `nullexxx:fix/vkd3d-empty-pipeline-library` → `main` · +14 −1 · 1 files · 1 commits · merged 2026-11-26 19:30 UTC ### Summary When starting without an existing pipeline library, `CreatePipelineLibrary(&[])` passes Rust's dangling non-null slice pointer (`0x1`) with length `0`. Windows ignores it, but `vkd3d-proton` rejects it with `E_INVALIDARG` (`no host pipeline library: pipelines are not kept`), preventing pipelines from persisting across runs under Wine/Proton. This passes `std::ptr::null()` when `bytes.is_empty()`, matching upstream `Marvisak/VIctory` commit `e5a8c2f` (PR #994). Windows behavior is unchanged. ### Testing - Cross-compiled with `cargo xwin build --target x86_64-pc-windows-msvc --locked --release -p victory` on CachyOS (Linux 7.3.6) and run under `GE-Proton11-14` (`vkd3d-proton 3.2`) on an RTX 5080 (`620.73.04`). - Before: `WARN victory_gpu::pipeline::library: no host pipeline library: pipelines are not kept` - After: `host pipeline library saved bytes=318968 early=1848 made=7 loaded=1862 started_early=1873`, and character models in cutscenes load from cache on subsequent launches. *AI-assisted (Gemini) patch and log analysis; built and verified locally on my own copy.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:39:40 +00:00
Author
Owner

@⁠mancube on GitHub · 2026-11-26 14:37 UTC · original

Confirmed tested on similar setup - CachyOS, vkd3d-proton, Proton11-14 with wineserver patch.

**@⁠mancube** on GitHub · 2026-11-26 14:37 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/31#issuecomment-7195099106) Confirmed tested on similar setup - CachyOS, vkd3d-proton, Proton11-14 with wineserver patch.
Author
Owner

@⁠welisonzika14-jpg on GitHub · 2026-11-26 15:35 UTC · original

Windows data for this PR, since it was only tried on Linux/Proton so far. RTX 5070 desktop (Blackwell, driver 621.24), Windows 11, Rust 1.98.1.

1. The call itself, on the native D3D12 runtime. A small standalone probe (windows crate 0.62.2, same as this tree) creates an ID3D12PipelineLibrary three ways, 2 runs each:

call RTX 5070 WARP
windows crate with an empty slice (what main does; its pointer is 0x1) S_OK S_OK
raw vtable call with a null pointer and length 0 (this PR) S_OK S_OK
windows crate with the library's own serialized blob (the non-empty path) S_OK S_OK

So on Windows the native runtime accepts both forms, and the reload path is untouched. The 0x1 pointer is only a problem for vkd3d-proton, which fits what you and @⁠mancube saw.

2. Unit tests. cargo test -p victory-gpu -p victory-shader --lib --locked --no-fail-fast with the PR merged onto fab5286: victory-gpu 347 passed / 0 failed, victory-shader 292 passed / 0 failed, the same as fab5286 alone. The PR adds no test.

Unit tests and a synthetic probe only, no game files.

Written with AI help (Claude/Kiro); the numbers are from runs on my machine.

**@⁠welisonzika14-jpg** on GitHub · 2026-11-26 15:35 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/31#issuecomment-7196491091) Windows data for this PR, since it was only tried on Linux/Proton so far. RTX 5070 desktop (Blackwell, driver 621.24), Windows 11, Rust 1.98.1. **1. The call itself, on the native D3D12 runtime.** A small standalone probe (windows crate 0.62.2, same as this tree) creates an `ID3D12PipelineLibrary` three ways, 2 runs each: | call | RTX 5070 | WARP | |---|---|---| | windows crate with an empty slice (what `main` does; its pointer is `0x1`) | S_OK | S_OK | | raw vtable call with a null pointer and length 0 (this PR) | S_OK | S_OK | | windows crate with the library's own serialized blob (the non-empty path) | S_OK | S_OK | So on Windows the native runtime accepts both forms, and the reload path is untouched. The `0x1` pointer is only a problem for vkd3d-proton, which fits what you and @⁠mancube saw. **2. Unit tests.** `cargo test -p victory-gpu -p victory-shader --lib --locked --no-fail-fast` with the PR merged onto `fab5286`: victory-gpu 347 passed / 0 failed, victory-shader 292 passed / 0 failed, the same as `fab5286` alone. The PR adds no test. Unit tests and a synthetic probe only, no game files. Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-26 19:18 UTC · original

The change is limited to the zero-length call. I queued CI for this revision. @⁠mancube, thanks for confirming the vkd3d-proton behavior. @⁠welisonzika14-jpg, your native D3D12 and WARP checks also cover the null-pointer call and the normal blob reload.

**@⁠TaynanGT** on GitHub · 2026-11-26 19:18 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/31#issuecomment-7201446125) The change is limited to the zero-length call. I queued CI for this revision. @⁠mancube, thanks for confirming the vkd3d-proton behavior. @⁠welisonzika14-jpg, your native D3D12 and WARP checks also cover the null-pointer call and the normal blob reload.
github manually merged commit 22c6eac8bd into main 2026-11-26 19:44:31 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-26 19:34 UTC · original

Merged as 22c6eac8. The Windows checks passed on the rerun, and the reports from Proton reproduced the empty-library failure and verified the null-pointer fix. The nonempty cache still uses the existing byte slice.

**@⁠TaynanGT** on GitHub · 2026-11-26 19:34 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/31#issuecomment-7201733998) Merged as `22c6eac8`. The Windows checks passed on the rerun, and the reports from Proton reproduced the empty-library failure and verified the null-pointer fix. The nonempty cache still uses the existing byte slice.
This discussion has been locked. Commenting is limited to contributors.
No description provided.