Repository navigation
Runtime: CreatePipelineLibrary and ID3D12PipelineLibrary1 answer their arguments as the host does - #3089
Conversation
0xTehuti
left a comment
There was a problem hiding this comment.
Hardware Certification Pass: Turing (RTX 2070 SUPER)
- Device: NVIDIA GeForce RTX 2070 SUPER (TU104, 8192 MB VRAM, Turing)
- Driver: NVIDIA 595.79.0.0 (Vulkan 1.4.329)
- Host: Windows 11 Pro x64 (Build 26100)
- Toolchain: MSVC 2022 Community x64 (
19.44.35225) + Ninja 1.13 + CMake 4.4 - Validation Layers: Khronos Validation Layers enabled (
LEONIDA_VK_VALIDATION=1)
Test Execution & Results
d3d12_pipeline_library_host: PASSED (12.75s)
Total: 1/1 tests passed (100%).
Verified on physical hardware: CreatePipelineLibrary and ID3D12PipelineLibrary1 argument answers, serialized library error paths, and HRESULT codes accurately match host D3D12 runtime expectations on Windows 11 with Turing hardware.
LGTM.
|
Tested Windows 11 Pro 10.0.26200, VS 2022 Build Tools (MSVC, Ninja, RelWithDebInfo), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0. The host side is the default adapter's native D3D12, an RTX 5080 on NVIDIA 621.01 (the PR used an RTX 3060 on 610.88). The layer ran on each GPU through
No validation messages in either run. The host answered the same "faults; not compared" calls as in your list (
The host side always used the default adapter, so this compares against NVIDIA's D3D12 only, not AMD's. |
|
Code review: the host-matching changes here are internally consistent.
No issue found in the diff from a code-reading standpoint. |
|
Tested b799d2a (merged onto main 1628210) on NVIDIA GeForce RTX 4060 Ti, driver 610.88 (32.0.16.1088), Windows 11 26200, MSVC 14.51.36231 (VS 2026), Vulkan SDK 1.4.363.0: pass
AI-assisted (Claude). |
b799d2a to
a5fa7dd
Compare
|
Rebased onto |
|
Tested |
…does d3d12_pipeline_library_host_test runs 46 CreatePipelineLibrary / ID3D12PipelineLibrary1 calls that need no pipeline state object on the Vulkan-backed device and on the host runtime, and compares each HRESULT and what happened to the output pointer (74 values). On the host every call runs in a child process with a fresh device: a call that faults there leaves the runtime broken, and in-process the next call failed fast (0xC0000409). On main 25 values differed (RTX 3060, driver 610.88); now none do: - A foreign, truncated or corrupt blob, the other device's serialized library, or a null pointer with a size is E_INVALIDARG, and the output pointer is left as it was (the layer answered DRIVER_VERSION_MISMATCH and nulled it). One of the layer's own blobs from another format version stays D3D12_ERROR_DRIVER_VERSION_MISMATCH. - A pipeline library is a device child, not a pageable object: QueryInterface(ID3D12Pageable) is E_NOINTERFACE. - Load*Pipeline with a null output is E_INVALIDARG, not E_POINTER. Not compared, and printed as such: the serialized size and bytes (each device's own), and the calls the host faults on (Serialize(nullptr, n), StorePipeline with a null PSO, Load* with a null name or description), which the layer answers E_INVALIDARG. d3d12_pipeline_library_test expected DRIVER_VERSION_MISMATCH for a foreign or tiny blob; it now expects E_INVALIDARG, and DRIVER_VERSION_MISMATCH for one of ours from another version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto |
a5fa7dd to
4abd83a
Compare
|
Tested a5fa7dd on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
|
Tested 4abd83a on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
New D3D item, claimed in #2891 (claim). It builds on @al3xar's pipeline library (#1772, D3D-34, on
main). No dependencies.What was wrong
CreatePipelineLibraryandID3D12PipelineLibrary1were only checked against hand-written expectations, never against the host. Measured on the host runtime, four answers differ:mainD3D12_ERROR_DRIVER_VERSION_MISMATCHE_INVALIDARG*ppPipelineLibraryset to nullQueryInterface(ID3D12Pageable)on a libraryS_OKE_NOINTERFACE(a library is a device child, not pageable)LoadComputePipeline/LoadGraphicsPipeline/LoadPipelinewith a null outputE_POINTERE_INVALIDARGThe first row matters most: it's the code an application branches on when its cache is stale. Microsoft's guidance treats
E_INVALIDARG,D3D12_ERROR_ADAPTER_NOT_FOUNDandD3D12_ERROR_DRIVER_VERSION_MISMATCHalike ("create an empty library"), so the host's answer is safe.The change
PipelineLibrary::check_blobreplacesvalid_blob. A blob of ours isS_OK. One of ours from another format version is stillD3D12_ERROR_DRIVER_VERSION_MISMATCH, the documented code for a cache from another driver. Anything else isE_INVALIDARG.CreatePipelineLibraryleaves the output alone on a refused blob. A wrong interface still nulls it, as on the host.ID3D12Pageableis gone from the library's interfaces. A null output on theLoad*calls isE_INVALIDARG.d3d12_pipeline_library_host_test:CreatePipelineLibrarywith null, empty, foreign, truncated, longer and corrupt blobs, the other device's serialized library, a null output and five interfaces.Serializewith null, short and long buffers,StorePipelinewith null PSOs, andLoad*with null, empty and unknown names and null descriptions or outputs.Serialize(nullptr, n), an access violation) leaves its runtime broken: in-process, the next call (Serialize(nullptr, 0)) then failed fast (0xC0000409), which no exception handler survives, and ended the whole test. Alone, that call is a plainE_INVALIDARG.Serialize(nullptr, n),StorePipelinewith a null PSO,Load*with a null name or description). The layer answersE_INVALIDARGfor each.d3d12_pipeline_library_testexpectedDRIVER_VERSION_MISMATCHfor a foreign and a tiny blob. It now expectsE_INVALIDARG, plusDRIVER_VERSION_MISMATCHfor one of ours with version 2.docs/d3d12_vulkan.md(the pipeline library paragraph) lists the rules.Tested
Windows 11 Pro 26300, MSVC 19.52 (VS 18 Build Tools, Ninja, RelWithDebInfo), NVIDIA GeForce RTX 3060, driver 610.88, Vulkan headers/loader 1.4.357:
d3d12_pipeline_library_host_testwithLEONIDA_VK_VALIDATION=1: 74 values compared, 20 not compared, 0 mismatches (~10 s, mostly the host's child processes).main's layer, 25 mismatches.d3d12_pipeline_library_testwith validation: ok (both PSOs stored, loaded, serialized, reloaded and run).ctest: 130/130 passed (glslang and the validation layer installed).No game files involved. AI-assisted (Claude Code).
🤖 Generated with Claude Code