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

Open
nullexxx wants to merge 1 commit from upstream-pr/31 into main
nullexxx commented 2026-11-26 13:39:40 +00:00 (Migrated from git.gtahub.st)

Imported from TaynanGT/Vice-Tay-v2. Originally posted by nullexxx on 2026-11-26T13:39:40Z.


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

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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay-v2:issue:13196 --> Imported from [TaynanGT/Vice-Tay-v2](https://git.gtahub.st/github/TaynanGT--Vice-Tay-v2/pulls/31). Originally posted by [nullexxx](https://github.com/nullexxx) on 2026-11-26T13:39:40Z. --- **@⁠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 · open ### 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.*
mancube commented 2026-11-26 14:41:31 +00:00 (Migrated from git.gtahub.st)

Imported from TaynanGT/Vice-Tay-v2. Originally posted by mancube on 2026-11-26T14:41:31Z.


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

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

<!-- greyfinch-sync:TaynanGT/Vice-Tay-v2:comment:197833 --> Imported from [TaynanGT/Vice-Tay-v2](https://git.gtahub.st/github/TaynanGT--Vice-Tay-v2/pulls/31#issuecomment-197833). Originally posted by [mancube](https://github.com/mancube) on 2026-11-26T14:41:31Z. --- **@⁠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.
welisonzika14-jpg commented 2026-11-26 15:40:08 +00:00 (Migrated from git.gtahub.st)

Imported from TaynanGT/Vice-Tay-v2. Originally posted by welisonzika14-jpg on 2026-11-26T15:40:08Z.


@⁠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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay-v2:comment:204558 --> Imported from [TaynanGT/Vice-Tay-v2](https://git.gtahub.st/github/TaynanGT--Vice-Tay-v2/pulls/31#issuecomment-204558). Originally posted by [welisonzika14-jpg](https://github.com/welisonzika14-jpg) on 2026-11-26T15:40:08Z. --- **@⁠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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/31:upstream-pr/31'
git switch 'upstream-pr/31'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/31'
git switch 'upstream-pr/31'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/31'
git switch 'upstream-pr/31'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/31'
git switch 'main'
git merge --squash 'upstream-pr/31'
git switch 'main'
git merge --ff-only 'upstream-pr/31'
git switch 'main'
git merge 'upstream-pr/31'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
TaynanGT/Vice-Tay-v2!31
No description provided.