Syntax
Parameters
pLibraryBlobType: const void * If the input library blob is empty, then the initial content of the library is empty. If the input library blob is not empty, then it is validated for integrity, parsed, and the pointer is stored. The pointer provided as input to this method must remain valid for the lifetime of the object returned. For efficiency reasons, the data is not copied. BlobLength
Type: SIZE_T Specifies the length of pLibraryBlob in bytes. riid
Type: const IID & Specifies a unique REFIID for the ID3D12PipelineLibrary object. Typically set this and the following parameter with the macro
IID_PPV_ARGS(&Library), where Library is the name of the object.
ppPipelineLibraryType: void ** Returns a pointer to the created library.
Return value
Type: HRESULT If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code, including E_INVALIDARG if the blob is corrupted or unrecognized, D3D12_ERROR_DRIVER_VERSION_MISMATCH if the provided data came from an old driver or runtime, and D3D12_ERROR_ADAPTER_NOT_FOUND if the data came from different hardware. If you passnullptr for pPipelineLibrary then the runtime still performs the validation of the blob but avoid creating the actual library and returns S_FALSE if the library would have been created.
Also, the feature requires an updated driver, and attempting to use it on old drivers will return DXGI_ERROR_UNSUPPORTED.
Remarks
A pipeline library enables the following operations.- Adding pipeline state objects (PSOs) to an existing library object (refer to StorePipeline).
- Serializing a PSO library into a contiguous block of memory for disk storage (refer to Serialize).
- De-serializing a PSO library from persistent storage (this is handled by CreatePipelineLibrary).
- Retrieving individual PSOs from the library (refer to LoadComputePipeline and LoadGraphicsPipeline).
Thread Safety
The pipeline library is thread-safe to use, and will internally synchronize as necessary, with one exception: multiple threads loading the same PSO (via LoadComputePipeline, LoadGraphicsPipeline, or LoadPipeline) should synchronize themselves, as this act may modify the state of that pipeline within the library in a non-thread-safe manner.Examples
See the Direct3D 12 pipeline state cache sample.Requirements
Header: d3d12_xs.h or d3d12_x.hLibrary: d3d12_xs.lib or d3d12_x.lib
Supported Platforms: XBOX Series consoles and XBOX One family
