ID3D12CommandQueue 인터페이스(d3d12.h)

명령 목록을 제출하고, 명령 목록 실행을 동기화하고, 명령 큐를 계측하고, 리소스 타일 매핑을 업데이트하는 메서드를 제공합니다.

상속

ID3D12CommandQueue 인터페이스는 ID3D12Pageable에서 상속됩니다. ID3D12CommandQueue 에는 다음과 같은 유형의 멤버도 있습니다.

메서드

ID3D12CommandQueue 인터페이스에는 이러한 메서드가 있습니다.

 
ID3D12CommandQueue::BeginEvent

직접 호출할 수 없습니다.  PIX 이벤트 런타임을 사용하여 명령 큐에 이벤트를 삽입합니다. (ID3D12CommandQueue.BeginEvent)
ID3D12CommandQueue::CopyTileMappings

원본 예약 리소스에서 대상 예약 리소스로 매핑을 복사합니다.
ID3D12CommandQueue::EndEvent

직접 호출할 수 없습니다.  PIX 이벤트 런타임을 사용하여 명령 큐에 이벤트를 삽입합니다. (ID3D12CommandQueue.EndEvent)
ID3D12CommandQueue::ExecuteCommandLists

실행을 위해 명령 목록 배열을 제출합니다.
ID3D12CommandQueue::GetClockCalibration

이 메서드는 동시에 CPU 및 GPU 타임스탬프 카운터를 샘플합니다.
ID3D12CommandQueue::GetDesc

명령 큐에 대한 설명을 가져옵니다.
ID3D12CommandQueue::GetTimestampFrequency

이 메서드는 GPU 타임스탬프 카운터가 증가되는 속도를 결정하는 데 사용됩니다.
ID3D12CommandQueue::SetMarker

직접 호출할 수 없습니다.  PIX 이벤트 런타임을 사용하여 명령 큐에 이벤트를 삽입합니다. (ID3D12CommandQueue.SetMarker)
ID3D12CommandQueue::Signal

펜스를 지정된 값으로 업데이트.
ID3D12CommandQueue::UpdateTileMappings

예약된 리소스의 타일 위치를 리소스 힙의 메모리 위치에 매핑하는 업데이트.
ID3D12CommandQueue::Wait

GPU 쪽 대기를 큐에 대기하고 즉시 반환합니다. GPU 쪽 대기는 지정된 펜스가 지정된 값에 도달하거나 초과할 때까지 GPU가 대기하는 위치입니다.

설명

ID3D12Device::CreateCommandQueue를 사용하여 명령 큐 개체를 만듭니다.

예제

D3D12nBodyGravity 샘플은 다음과 같이 ID3D12CommandQueue를 사용합니다.

헤더 파일 선언.

// Compute objects.
ComPtr<ID3D12CommandAllocator> m_computeAllocator[ThreadCount];
ComPtr<ID3D12CommandQueue> m_computeCommandQueue[ThreadCount];
ComPtr<ID3D12GraphicsCommandList> m_computeCommandList[ThreadCount];

비동기 컴퓨팅 스레드.

DWORD D3D12nBodyGravity::AsyncComputeThreadProc(int threadIndex)
{
    ID3D12CommandQueue* pCommandQueue = m_computeCommandQueue[threadIndex].Get();
    ID3D12CommandAllocator* pCommandAllocator = m_computeAllocator[threadIndex].Get();
    ID3D12GraphicsCommandList* pCommandList = m_computeCommandList[threadIndex].Get();
    ID3D12Fence* pFence = m_threadFences[threadIndex].Get();

    while (0 == InterlockedGetValue(&m_terminating))
    {
        // Run the particle simulation.
        Simulate(threadIndex);

        // Close and execute the command list.
        ThrowIfFailed(pCommandList->Close());
        ID3D12CommandList* ppCommandLists[] = { pCommandList };

        pCommandQueue->ExecuteCommandLists(1, ppCommandLists);

        // 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);

        // Wait for the render thread to be done with the SRV so that
        // the next frame in the simulation can run.
        UINT64 renderContextFenceValue = InterlockedGetValue(&m_renderContextFenceValues[threadIndex]);
        if (m_renderContextFence->GetCompletedValue() < renderContextFenceValue)
        {
            ThrowIfFailed(pCommandQueue->Wait(m_renderContextFence.Get(), renderContextFenceValue));
            InterlockedExchange(&m_renderContextFenceValues[threadIndex], 0);
        }

        // Swap the indices to the SRV and UAV.
        m_srvIndex[threadIndex] = 1 - m_srvIndex[threadIndex];

        // Prepare for the next frame.
        ThrowIfFailed(pCommandAllocator->Reset());
        ThrowIfFailed(pCommandList->Reset(pCommandAllocator, m_computeState.Get()));
    }

    return 0;
}

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

요구 사항

   
대상 플랫폼 Windows
헤더 d3d12.h

참고 항목

Core 인터페이스

ID3D12Pageable