ID3D12Fence::SetEventOnCompletion 메서드(d3d12.h)

펜스가 특정 값에 도달할 때 발생하는 이벤트를 지정합니다.

구문

HRESULT SetEventOnCompletion(
  UINT64 Value,
  HANDLE hEvent
);

매개 변수

Value

형식: UINT64

이벤트를 신호로 보낼 때의 펜스 값입니다.

hEvent

형식: HANDLE

이벤트 개체에 대한 핸들입니다.

반환 값

형식: HRESULT

이 메서드는 커널 구성 요소에 목록에 이벤트를 저장할 충분한 메모리가 없는 경우 E_OUTOFMEMORY 반환합니다. 가능한 다른 반환 값은 Direct3D 12 반환 코드를 참조하세요.

설명

이벤트가 트리거되기 전에 여러 펜스를 지정하려면 SetEventOnMultipleFenceCompletion을 참조하세요.

hEvent가 null 핸들인 경우 지정된 펜스 값에 도달할 때까지 이 API는 반환되지 않습니다.

이 메서드는 한 번에 여러 스레드에서 안전하게 호출할 수 있습니다.

예제

D3D12Multithreading 샘플에서는 다음과 같이 ID3D12Fence::SetEventOnCompletion을 사용합니다.

// Wait for the command list to execute; we are reusing the same command 
// list in our main loop but for now, we just want to wait for setup to 
// complete before continuing.

// Signal and increment the fence value.
const UINT64 fenceToWaitFor = m_fenceValue;
ThrowIfFailed(m_commandQueue->Signal(m_fence.Get(), fenceToWaitFor));
m_fenceValue++;

// Wait until the fence is completed.
ThrowIfFailed(m_fence->SetEventOnCompletion(fenceToWaitFor, m_fenceEvent));
WaitForSingleObject(m_fenceEvent, INFINITE);

Direct3D 12 참조의 예제 코드를 참조하세요.

요구 사항

   
대상 플랫폼 Windows
헤더 d3d12.h
라이브러리 D3D12.lib
DLL D3D12.dll

추가 정보

ID3D12Fence

다중 엔진 동기화