> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Serialize

> Writes the contents of the library to the provided memory, to be provided back to the runtime at a later time.

Writes the contents of the library to the provided memory, to be provided back to the runtime at a later time.

## Syntax

```cpp theme={null}
HRESULT Serialize(
    void  pData,
    SIZE_T DataSizeInBytes
)
```

### Parameters

*pData \[out]*\
Type: void \*

Specifies a pointer to the data. This memory must be readable and writable up to the input size. This data can be saved and provided to [CreatePipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public) at a later time, including future instances of this or other processes. The data becomes invalidated if the runtime or driver is updated, and is not portable to other hardware or devices.

*DataSizeInBytes*\
Type: SIZE\_T

The size provided must be at least the size returned from [GetSerializedSize](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_getserializedsize_public).

### Return value

Type: HRESULT

This method returns an HRESULT success or error code, including E\_INVALIDARG if the buffer provided isn't big enough.

## Remarks

Refer to the remarks and examples for [CreatePipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public).

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[ID3D12PipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/id3d12pipelinelibrary_public)


## Related topics

- [PartyManager::SerializeNetworkDescriptor](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_serializenetworkdescriptor.md)
- [D3D12SerializeRootSignature](/reference/graphics/d3d12/functions/d3d12serializerootsignature_public.md)
- [GetSerializedSize](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_getserializedsize_public.md)
- [D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER](/reference/graphics/d3d12/structs/d3d12_serialized_data_driver_matching_identifier_public.md)
- [D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER](/reference/graphics/d3d12/structs/d3d12_serialized_raytracing_acceleration_structure_header_public.md)
