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

# ID3D12CommandQueue::Signal

> ID3D12CommandQueue::Signal (Direct3D 12 on XBOX) — Updates a fence to a specified value. Direct3D 12 graphics API reference for XBOX game development.

Updates a fence to a specified value.

## Syntax

```cpp theme={null}
HRESULT Signal(
    ID3D12Fence  pFence,
    UINT64 Value
)
```

### Parameters

*pFence*\
Type: ID3D12Fence \*

A pointer to the [ID3D12Fence](/reference/graphics/d3d12/interfaces/id3d12fence/id3d12fence_public) object.

*Value*\
Type: UINT64

The value to set the fence to.

### Return value

Type: HRESULT

This method returns one of the [Direct3D 12 Return Codes](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12-graphics-reference-returnvalues).

## Remarks

Use this method to set a fence value from the GPU side. Use [ID3D12Fence::Signal](/reference/graphics/d3d12/interfaces/id3d12fence/methods/id3d12fence_signal_public) to set a fence from the CPU side.

#### Examples

Adds a signal to the command queue, then waits for the compute shader to complete the simulation, finally signal and increment the fence value.

```cpp theme={null}
// Wait for the compute shader to complete the simulation.
UINT64 threadFenceValue = InterlockedIncrement(&m_threadFenceValues[threadIndex]);
ThrowIfFailed(pCommandQueue->Signal(pFence, threadFenceValue));
ThrowIfFailed(pFence->SetEventOnCompletion(threadFenceValue, m_threadFenceEvents[threadIndex]));
WaitForSingleObject(m_threadFenceEvents[threadIndex], INFINITE);

```

```cpp theme={null}
// Add a signal command to the queue.
ThrowIfFailed(m_commandQueue->Signal(m_renderContextFence.Get(), m_renderContextFenceValue));

```

```cpp theme={null}
// Signal and increment the fence value.
ThrowIfFailed(m_commandQueue->Signal(m_renderContextFence.Get(), m_renderContextFenceValue));
m_renderContextFenceValue++;

```

Refer to the [Example Code in the D3D12 Reference](https://learn.microsoft.com/en-us/windows/win32/direct3d12/notes-on-example-code).

<div class="code" />

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

[ID3D12CommandQueue](/reference/graphics/d3d12_xs/interfaces/ID3D12CommandQueue/id3d12commandqueue_xs)

[Multi-engine synchronization](https://learn.microsoft.com/en-us/windows/win32/direct3d12/user-mode-heap-synchronization)


## Related topics

- [ID3D12Fence::Signal](/reference/graphics/d3d12/interfaces/id3d12fence/methods/id3d12fence_signal_public.md)
- [ID3D12CommandQueue::GetDesc](/reference/graphics/d3d12/interfaces/id3d12commandqueue/methods/id3d12commandqueue_getdesc_public.md)
- [D3D12_COMMAND_QUEUE_DESC](/reference/graphics/d3d12/structs/d3d12_command_queue_desc_public.md)
- [D3D12_COMMAND_QUEUE_PRIORITY](/reference/graphics/d3d12/enums/d3d12_command_queue_priority_public.md)
- [D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY](/reference/graphics/d3d12/structs/d3d12_feature_data_command_queue_priority_public.md)
