Skip to content

Latest commit

 

History

History
119 lines (84 loc) · 3.4 KB

nf-d3d12-id3d12commandqueue-signal.md

File metadata and controls

119 lines (84 loc) · 3.4 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:d3d12.ID3D12CommandQueue.Signal
ID3D12CommandQueue::Signal (d3d12.h)
Updates a fence to a specified value.
ID3D12CommandQueue interface
Signal method
ID3D12CommandQueue.Signal
ID3D12CommandQueue::Signal
Signal
Signal method
Signal method
ID3D12CommandQueue interface
d3d12/ID3D12CommandQueue::Signal
direct3d12.id3d12commandqueue_signal
direct3d12\id3d12commandqueue_signal.htm
direct3d12
487E2DED-C741-4376-9EE2-3DDD2F4F76BB
12/05/2018
ID3D12CommandQueue interface,Signal method, ID3D12CommandQueue.Signal, ID3D12CommandQueue::Signal, Signal, Signal method, Signal method,ID3D12CommandQueue interface, d3d12/ID3D12CommandQueue::Signal, direct3d12.id3d12commandqueue_signal
d3d12.h
Windows
D3D12.lib
D3D12.dll
Windows
19H1
ID3D12CommandQueue::Signal
d3d12/ID3D12CommandQueue::Signal
c++
APIRef
kbSyntax
COM
D3D12.dll
ID3D12CommandQueue.Signal

ID3D12CommandQueue::Signal

-description

Updates a fence to a specified value.

-parameters

-param pFence

Type: ID3D12Fence*

A pointer to the ID3D12Fence object.

-param Value

Type: UINT64

The value to set the fence to.

-returns

Type: HRESULT

This method returns one of the Direct3D 12 Return Codes.

-remarks

Use this method to set a fence value from the GPU side. Use ID3D12Fence::Signal 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.

// 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);
// Add a signal command to the queue.
ThrowIfFailed(m_commandQueue->Signal(m_renderContextFence.Get(), m_renderContextFenceValue));
// 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.

-see-also

ID3D12CommandQueue

Multi-engine synchronization