Skip to content

runtime: implement ID3D12Device1::CreatePipelineLibrary and ID3D12PipelineLibrary1 - #1772

Merged
ItsNotRexed merged 1 commit into
ProjectLeonida:mainfrom
al3xar:feat/d3d12-pipeline-library
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ProjectLeonida:mainfrom
al3xar:feat/d3d12-pipeline-library

Conversation

@al3xar

@al3xar al3xar commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

What and why

Implements ID3D12Device1::CreatePipelineLibrary and the ID3D12PipelineLibrary / ID3D12PipelineLibrary1 COM object (StorePipeline, LoadGraphicsPipeline, LoadComputePipeline, LoadPipeline, GetSerializedSize, Serialize) on the Vulkan-backed D3D12 device (docs/d3d12_vulkan.md sections 3.6 and 4; listed in #313's objects table and left as follow-up work by #367):

  • CreatePipelineLibrary accepts an empty blob (pLibraryBlob == nullptr, BlobLength == 0) or a serialized "LPL1" library header, answers S_FALSE for a null-output capability check, rejects BlobLength > 0 with pLibraryBlob == nullptr as E_INVALIDARG, and rejects foreign or corrupt blobs with D3D12_ERROR_DRIVER_VERSION_MISMATCH.
  • StorePipeline retains PSOs created by this device under unique non-empty names and rejects duplicate names, null/empty names, or foreign PSOs with E_INVALIDARG.
  • LoadComputePipeline, LoadGraphicsPipeline, and ID3D12PipelineLibrary1::LoadPipeline look up stored PSOs by name (rejecting compute/graphics cross-type mismatches and invalid arguments with E_INVALIDARG).
  • GetSerializedSize and Serialize write a versioned 16-byte header ("LPL1", version 1) that round-trips through CreatePipelineLibrary.

Claim: #1745 (comment)

Tested

  • Windows 11, Visual Studio 2022 Build Tools (MSVC 19.44.35230.0, Windows SDK 10.0.26100.0), NVIDIA GeForce RTX 3060 (driver 621.24, Vulkan 1.4.357).
  • d3d12_pipeline_library_test.exe with LEONIDA_VK_VALIDATION=1: passed with 0 Vulkan validation errors.
  • No game data used. AI-assisted implementation and testing.

@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Independently verified commit f179b68a on Windows 11 (MSVC 19.44, Ninja, VK_LOADER_LAYERS_DISABLE=~implicit~, synthetic scene):

  • NVIDIA GeForce RTX 5080 (driver 616.92, Vulkan 1.4.351):
    • d3d12_pipeline_library_test.exe: PASS (exit=0) — d3d12_pipeline_library_test: ok.
  • AMD Radeon(TM) Graphics (driver 26.10.1, Vulkan 1.4.315):
    • d3d12_pipeline_library_test.exe: PASS (exit=0) — d3d12_pipeline_library_test: ok.
  • Note: VK_LAYER_KHRONOS_validation is not installed locally.

AI Assisted.

@al3xar
al3xar force-pushed the feat/d3d12-pipeline-library branch from f179b68 to d38daa4 Compare November 22, 2026 14:27
@kapitche

Copy link
Copy Markdown
Collaborator

Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): no regression from this PR. RTX 4080 SUPER: 101/102 pass. d3d12_draw fails on both GPUs, but it fails the same way on every PR built on current main (bundle blend pixel (0, 0): got 255,0,0,255, expected red 64), so it's a main regression, not from this PR. I'm bisecting it now and will report in the coordination issue. Other Intel UHD 770 failures are the known ones in #1548.

@Spaghetih

Copy link
Copy Markdown
Contributor

Tested d38daa4e on NVIDIA GeForce RTX 4070 Ti, driver 621.24, Windows 11, MSVC (VS 2022), Vulkan SDK 1.4.363, llvm-mc 21.1.8 in WSL: pass.

No regression against main on the same machine (ctest 97/98 with the same d3d12_draw failure; GPU suite 127/166 passed, 39 skipped, 0 failed).

AI-assisted (Claude Code).

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.

5 participants