> ## 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.

# WriteBufferImmediate

> Writes a number of 32-bit immediate values to the specified buffer locations directly from the command stream. (ID3D12GraphicsCommandList2.WriteBufferImmediate)

Writes a number of 32-bit immediate values to the specified buffer locations directly from the command stream.

## Syntax

```cpp theme={null}
void WriteBufferImmediate(
    UINT Count,
    const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER  pParams,
    const D3D12_WRITEBUFFERIMMEDIATE_MODE  pModes
)
```

### Parameters

*Count*\
Type: UINT

The number of [D3D12\_WRITEBUFFERIMMEDIATE\_PARAMETER](/reference/graphics/d3d12/structs/d3d12_writebufferimmediate_parameter_public) structures that are pointed to by <i>pParams</i> and <i>pModes</i>.

*pParams \[in]*\
Type: const D3D12\_WRITEBUFFERIMMEDIATE\_PARAMETER \*

The address of an array containing a number of [D3D12\_WRITEBUFFERIMMEDIATE\_PARAMETER](/reference/graphics/d3d12/structs/d3d12_writebufferimmediate_parameter_public) structures equal to <i>Count</i>.

*pModes \[in, optional]*\
Type: const D3D12\_WRITEBUFFERIMMEDIATE\_MODE \*

The address of an array containing a number of  [D3D12\_WRITEBUFFERIMMEDIATE\_MODE](/reference/graphics/d3d12/enums/d3d12_writebufferimmediate_mode_public) structures equal to <i>Count</i>. The default value is **null**; passing **null** causes the system to write all immediate values using **D3D12\_WRITEBUFFERIMMEDIATE\_MODE\_DEFAULT**.

### Return value

Type: void

None.

## Remarks

**WriteBufferImmediate** performs <i>Count</i> number of 32-bit writes: one for each value and destination specified in <i>pParams</i>.

The receiving buffer (resource) must be in the **D3D12\_RESOURCE\_STATE\_COPY\_DEST** state to be a valid destination for **WriteBufferImmediate**.

## 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

[ID3D12GraphicsCommandList2](/reference/graphics/d3d12_x/interfaces/ID3D12GraphicsCommandList2/id3d12graphicscommandlist2)


## Related topics

- [D3D12_WRITEBUFFERIMMEDIATE_PARAMETER](/reference/graphics/d3d12/structs/d3d12_writebufferimmediate_parameter_public.md)
- [D3D12_WRITEBUFFERIMMEDIATE_MODE](/reference/graphics/d3d12/enums/d3d12_writebufferimmediate_mode_public.md)
- [D3D12_FEATURE_DATA_D3D12_OPTIONS3](/reference/graphics/d3d12/structs/d3d12_feature_data_d3d12_options3_public.md)
- [GetShapePcmReadPointer](/reference/audio/shapepcmcontext/functions/getshapepcmreadpointer.md)
- [SetShapePcmReadPointer](/reference/audio/shapepcmcontext/functions/setshapepcmreadpointer.md)
