GPU: ask for an empty pipeline library with a null blob #1494

Closed
OctoAlgo wants to merge 1 commit from upstream-pr/1494 into main
OctoAlgo commented 2026-11-27 18:28:54 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by OctoAlgo on 2026-11-27T18:28:54Z.


What breaks under Proton. When there is no saved pipeline library yet, open asks for an empty one with
CreatePipelineLibrary(&[]). windows-rs passes an empty slice as a non-null address with length 0. D3D12 documents the
empty form as a null pointer with length 0, and vkd3d-proton refuses the other form. So under Wine/Proton no library is
ever made, nothing is saved, and every start makes all of its pipelines again. The log says so on every start:

WARN victory_gpu::pipeline::library: no host pipeline library: pipelines are not kept

Change. The empty library is made through the vtable with a null blob (empty). If the host refuses it anyway, the
error is logged instead of being dropped. A saved blob is loaded as before. A WARP test checks that the empty library is
made (on Windows; it skips where the adapter is not a software one).

Measured (RTX 5070 Ti, Proton 11 with vkd3d-proton, Series S profile, the same save, two starts in a row):

  • Before (main as published + an unrelated shader fix, same setup, logs t1/t2): every start logs
    no host pipeline library yet; starting an empty one and then no host pipeline library: pipelines are not kept.
  • After, first start (pa1): no host pipeline library yet; starting an empty one, then
    host pipeline library saved bytes=248 early=1 made=1 loaded=0.
  • After, second start on the same cache (pa2): host pipeline library loaded bytes=248 mapped=true; no "not kept".
  • These two starts stayed at the start screen (the scripted keys of our test harness did not drive this build), so they
    show the library being made, saved and loaded, not a warm world. The same change (identical calls) inside a larger local
    test build reached the world on the RTX 5090, Series X: first start saved bytes=107192/134840, next start
    loaded bytes=134840 ... loaded=552, i.e. the second start loads its pipelines instead of making them all again.

Not tested: Windows (the change should be a no-op there; WARP test compiled, not run), AMD, other Proton builds.
The runs above were on 3e573d255; on f299fba1a the commit is unchanged and the Windows-target check (lib + tests) is clean, not re-run in game.

Related. #259 and #1056 work around the same symptom by saving the early list when there is no library. This change makes the library itself work under vkd3d-proton, so the two approaches do not conflict.

(written with AI assistance)

<!-- greyfinch-sync:fxceless/victory-fork:issue:5531378078 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1494). Originally posted by [OctoAlgo](https://github.com/OctoAlgo) on 2026-11-27T18:28:54Z. --- **What breaks under Proton.** When there is no saved pipeline library yet, `open` asks for an empty one with `CreatePipelineLibrary(&[])`. windows-rs passes an empty slice as a non-null address with length 0. D3D12 documents the empty form as a null pointer with length 0, and vkd3d-proton refuses the other form. So under Wine/Proton no library is ever made, nothing is saved, and every start makes all of its pipelines again. The log says so on every start: WARN victory_gpu::pipeline::library: no host pipeline library: pipelines are not kept **Change.** The empty library is made through the vtable with a null blob (`empty`). If the host refuses it anyway, the error is logged instead of being dropped. A saved blob is loaded as before. A WARP test checks that the empty library is made (on Windows; it skips where the adapter is not a software one). **Measured** (RTX 5070 Ti, Proton 11 with vkd3d-proton, Series S profile, the same save, two starts in a row): - Before (main as published + an unrelated shader fix, same setup, logs t1/t2): every start logs `no host pipeline library yet; starting an empty one` and then `no host pipeline library: pipelines are not kept`. - After, first start (pa1): `no host pipeline library yet; starting an empty one`, then `host pipeline library saved bytes=248 early=1 made=1 loaded=0`. - After, second start on the same cache (pa2): `host pipeline library loaded bytes=248 mapped=true`; no "not kept". - These two starts stayed at the start screen (the scripted keys of our test harness did not drive this build), so they show the library being made, saved and loaded, not a warm world. The same change (identical calls) inside a larger local test build reached the world on the RTX 5090, Series X: first start `saved bytes=107192`/`134840`, next start `loaded bytes=134840 ... loaded=552`, i.e. the second start loads its pipelines instead of making them all again. **Not tested:** Windows (the change should be a no-op there; WARP test compiled, not run), AMD, other Proton builds. The runs above were on 3e573d255; on f299fba1a the commit is unchanged and the Windows-target check (lib + tests) is clean, not re-run in game. **Related.** #259 and #1056 work around the same symptom by saving the early list when there is no library. This change makes the library itself work under vkd3d-proton, so the two approaches do not conflict. *(written with AI assistance)*
Filip722 commented 2026-11-27 18:31:33 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-27T18:31:33Z.


This overlaps #885, which is already updated for the rebased main and uses the same null-pointer and zero-length call. On the RTX 5060 Laptop under GE-Proton11-14, the original rejected-blob fallback test failed, and all six library tests passed with that change. Your cold-to-warm results add coverage from another system. Physical RTX test result

Assisted by Codex (GPT-6.2-Sol High).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7225577934 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1494#issuecomment-7225577934). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-27T18:31:33Z. --- This overlaps #885, which is already updated for the rebased main and uses the same null-pointer and zero-length call. On the RTX 5060 Laptop under GE-Proton11-14, the original rejected-blob fallback test failed, and all six library tests passed with that change. Your cold-to-warm results add coverage from another system. [Physical RTX test result](https://github.com/fxceless/victory-fork/pull/885#issuecomment-7224349110) Assisted by Codex (GPT-6.2-Sol High).

Pull request closed

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
fxceless/victory-fork!1494
No description provided.