ID3D12GraphicsCommandList 인터페이스(d3d12.h)

렌더링을 위한 그래픽 명령 목록을 캡슐화합니다. 명령 목록 실행을 계측하고 파이프라인 상태를 설정 및 지우기 위한 API를 포함합니다.

참고 이 인터페이스의 최신 버전은 Windows 10 크리에이터스 업데이트 도입된 ID3D12GraphicsCommandList1입니다. Windows 10 크리에이터스 업데이트 대상으로 하는 애플리케이션은 ID3D12GraphicsCommandList 대신 ID3D12GraphicsCommandList1 인터페이스를 사용해야 합니다.
 

상속

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

메서드

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

 
ID3D12GraphicsCommandList::BeginEvent

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

실행 중인 쿼리를 시작합니다. (ID3D12GraphicsCommandList.BeginQuery)
ID3D12GraphicsCommandList::ClearDepthStencilView

깊이 스텐실 리소스를 지웁니다. (ID3D12GraphicsCommandList.ClearDepthStencilView)
ID3D12GraphicsCommandList::ClearRenderTargetView

렌더링 대상의 모든 요소를 하나의 값으로 설정합니다.
ID3D12GraphicsCommandList::ClearState

직접 명령 목록의 상태를 명령 목록을 만들 때의 상태로 다시 설정합니다. (ID3D12GraphicsCommandList.ClearState)
ID3D12GraphicsCommandList::ClearUnorderedAccessViewFloat

순서가 지정되지 않은 액세스 뷰의 모든 요소를 지정된 float 값으로 설정합니다.
ID3D12GraphicsCommandList::ClearUnorderedAccessViewUint

UAV(순서가 지정되지 않은 액세스 뷰)의 모든 요소를 지정된 정수 값으로 설정합니다.
ID3D12GraphicsCommandList::Close

명령 목록에 대한 기록이 완료되었음을 나타냅니다. (ID3D12GraphicsCommandList.Close)
ID3D12GraphicsCommandList::CopyBufferRegion

버퍼의 영역을 한 리소스에서 다른 리소스로 복사합니다.
ID3D12GraphicsCommandList::CopyResource

원본 리소스의 전체 내용을 대상 리소스에 복사합니다.
ID3D12GraphicsCommandList::CopyTextureRegion

이 메서드는 GPU를 사용하여 두 위치 간에 텍스처 데이터를 복사합니다. 원본과 대상 모두 버퍼 리소스 또는 텍스처 리소스 내에 있는 텍스처 데이터를 참조할 수 있습니다.
ID3D12GraphicsCommandList::CopyTiles

타일을 버퍼에서 바둑판형 리소스로 복사하거나 그 반대로 복사합니다. (ID3D12GraphicsCommandList.CopyTiles)
ID3D12GraphicsCommandList::D iscardResource

리소스를 삭제합니다.
ID3D12GraphicsCommandList::D spatch

스레드 그룹에서 컴퓨팅 셰이더를 실행합니다.
ID3D12GraphicsCommandList::D rawIndexedInstanced

인덱싱된 인스턴스화된 기본 형식을 그립니다.
ID3D12GraphicsCommandList::DrawInstanced

인덱싱되지 않은 인스턴스화된 기본 형식을 그립니다.
ID3D12GraphicsCommandList::EndEvent

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

실행 중인 쿼리를 종료합니다.
ID3D12GraphicsCommandList::ExecuteBundle

번들을 실행합니다.
ID3D12GraphicsCommandList::ExecuteIndirect

앱은 ExecuteIndirect 메서드를 사용하여 간접 그리기/디스패치를 수행합니다.
ID3D12GraphicsCommandList::IASetIndexBuffer

인덱스 버퍼에 대한 뷰를 설정합니다.
ID3D12GraphicsCommandList::IASetPrimitiveTopology

기본 형식 및 입력 어셈블러 단계의 입력 데이터를 설명하는 데이터 순서에 대한 정보를 바인딩합니다. (ID3D12GraphicsCommandList.IASetPrimitiveTopology)
ID3D12GraphicsCommandList::IASetVertexBuffers

꼭짓점 버퍼에 대한 CPU 설명자 핸들을 설정합니다.
ID3D12GraphicsCommandList::OMSetBlendFactor

픽셀 셰이더, 렌더링 대상 또는 둘 다에 대한 값을 변조하는 혼합 요소를 설정합니다.
ID3D12GraphicsCommandList::OMSetRenderTargets

렌더링 대상 및 깊이 스텐실에 대한 CPU 설명자 핸들을 설정합니다.
ID3D12GraphicsCommandList::OMSetStencilRef

깊이 스텐실 테스트에 대한 참조 값을 설정합니다.
ID3D12GraphicsCommandList::Reset

새 명령 목록을 방금 만든 것처럼 명령 목록을 초기 상태로 다시 설정합니다. (ID3D12GraphicsCommandList.Reset)
ID3D12GraphicsCommandList::ResolveQueryData

쿼리에서 데이터를 추출합니다. ResolveQueryData는 모든 힙 형식(기본, 업로드 및 다시 읽기)에 작동합니다.  ResolveQueryData는 모든 힙 형식(기본, 업로드 및 다시 읽기)에 작동합니다. .
ID3D12GraphicsCommandList::ResolveSubresource

다중 샘플링된 리소스를 다중 샘플링이 아닌 리소스에 복사합니다.
ID3D12GraphicsCommandList::ResourceBarrier

드라이버에 리소스에 대한 여러 액세스를 동기화해야 한다는 것을 알 수 있습니다. (ID3D12GraphicsCommandList.ResourceBarrier)
ID3D12GraphicsCommandList::RSSetScissorRects

가위 사각형 배열을 래스터라이저 단계에 바인딩합니다.
ID3D12GraphicsCommandList::RSSetViewports

뷰포트 배열을 파이프라인의 래스터라이저 단계에 바인딩합니다. (ID3D12GraphicsCommandList.RSSetViewports)
ID3D12GraphicsCommandList::SetComputeRoot32BitConstant

컴퓨팅 루트 서명에서 상수를 설정합니다.
ID3D12GraphicsCommandList::SetComputeRoot32BitConstants

컴퓨팅 루트 서명에서 상수 그룹을 설정합니다.
ID3D12GraphicsCommandList::SetComputeRootConstantBufferView

컴퓨팅 루트 서명의 상수 버퍼에 대한 CPU 설명자 핸들을 설정합니다.
ID3D12GraphicsCommandList::SetComputeRootDescriptorTable

설명자 테이블을 컴퓨팅 루트 서명으로 설정합니다.
ID3D12GraphicsCommandList::SetComputeRootShaderResourceView

컴퓨팅 루트 서명의 셰이더 리소스에 대한 CPU 설명자 핸들을 설정합니다.
ID3D12GraphicsCommandList::SetComputeRootSignature

컴퓨팅 루트 서명의 레이아웃을 설정합니다.
ID3D12GraphicsCommandList::SetComputeRootUnorderedAccessView

컴퓨팅 루트 서명에서 순서가 지정되지 않은 액세스 보기 리소스에 대한 CPU 설명자 핸들을 설정합니다.
ID3D12GraphicsCommandList::SetDescriptorHeaps

명령 목록과 연결된 현재 바인딩된 설명자 힙을 변경합니다.
ID3D12GraphicsCommandList::SetGraphicsRoot32BitConstant

그래픽 루트 서명에서 상수를 설정합니다.
ID3D12GraphicsCommandList::SetGraphicsRoot32BitConstants

그래픽 루트 서명에서 상수 그룹을 설정합니다.
ID3D12GraphicsCommandList::SetGraphicsRootConstantBufferView

그래픽 루트 서명의 상수 버퍼에 대한 CPU 설명자 핸들을 설정합니다.
ID3D12GraphicsCommandList::SetGraphicsRootDescriptorTable

설명자 테이블을 그래픽 루트 서명으로 설정합니다.
ID3D12GraphicsCommandList::SetGraphicsRootShaderResourceView

그래픽 루트 서명의 셰이더 리소스에 대한 CPU 설명자 핸들을 설정합니다.
ID3D12GraphicsCommandList::SetGraphicsRootSignature

그래픽 루트 서명의 레이아웃을 설정합니다.
ID3D12GraphicsCommandList::SetGraphicsRootUnorderedAccessView

그래픽 루트 서명에서 순서가 지정되지 않은 액세스 보기 리소스에 대한 CPU 설명자 핸들을 설정합니다.
ID3D12GraphicsCommandList::SetMarker

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

모든 셰이더를 설정하고 GPU(그래픽 처리 장치) 파이프라인의 고정 함수 상태 대부분을 프로그래밍합니다.
ID3D12GraphicsCommandList::SetPredication

렌더링 조건자를 설정합니다.
ID3D12GraphicsCommandList::SOSetTargets

스트림 출력 버퍼 뷰를 설정합니다.

설명

이 인터페이스는 D3D12의 새로운 기능으로, ID3D11CommandList 인터페이스의 많은 기능을 캡슐화하고 렌더링에 설명된 새로운 기능을 포함합니다.

예제

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

파이프라인 개체를 선언합니다.

D3D12_VIEWPORT m_viewport;
D3D12_RECT m_scissorRect;
ComPtr<IDXGISwapChain3> m_swapChain;
ComPtr<ID3D12Device> m_device;
ComPtr<ID3D12Resource> m_renderTargets[FrameCount];
ComPtr<ID3D12CommandAllocator> m_commandAllocator;
ComPtr<ID3D12CommandQueue> m_commandQueue;
ComPtr<ID3D12RootSignature> m_rootSignature;
ComPtr<ID3D12DescriptorHeap> m_rtvHeap;
ComPtr<ID3D12PipelineState> m_pipelineState;
ComPtr<ID3D12GraphicsCommandList> m_commandList;
UINT m_rtvDescriptorSize;

명령 목록을 채웁니다.

// Fill the command list with all the render commands and dependent state.
void D3D12nBodyGravity::PopulateCommandList()
{
    // Command list allocators can only be reset when the associated
    // command lists have finished execution on the GPU; apps should use
    // fences to determine GPU execution progress.
    ThrowIfFailed(m_commandAllocators[m_frameIndex]->Reset());

    // However, when ExecuteCommandList() is called on a particular command
    // list, that command list can then be reset at any time and must be before
    // re-recording.
    ThrowIfFailed(m_commandList->Reset(m_commandAllocators[m_frameIndex].Get(), m_pipelineState.Get()));

    // Set necessary state.
    m_commandList->SetPipelineState(m_pipelineState.Get());
    m_commandList->SetGraphicsRootSignature(m_rootSignature.Get());

    m_commandList->SetGraphicsRootConstantBufferView(RootParameterCB, m_constantBufferGS->GetGPUVirtualAddress() + m_frameIndex * sizeof(ConstantBufferGS));

    ID3D12DescriptorHeap* ppHeaps[] = { m_srvUavHeap.Get() };
    m_commandList->SetDescriptorHeaps(_countof(ppHeaps), ppHeaps);

    m_commandList->IASetVertexBuffers(0, 1, &m_vertexBufferView);
    m_commandList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_POINTLIST);
    m_commandList->RSSetScissorRects(1, &m_scissorRect);

    // Indicate that the back buffer will be used as a render target.
    m_commandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(m_renderTargets[m_frameIndex].Get(), D3D12_RESOURCE_STATE_PRESENT, D3D12_RESOURCE_STATE_RENDER_TARGET));

    CD3DX12_CPU_DESCRIPTOR_HANDLE rtvHandle(m_rtvHeap->GetCPUDescriptorHandleForHeapStart(), m_frameIndex, m_rtvDescriptorSize);
    m_commandList->OMSetRenderTargets(1, &rtvHandle, FALSE, nullptr);

    // Record commands.
    const float clearColor[] = { 0.0f, 0.0f, 0.1f, 0.0f };
    m_commandList->ClearRenderTargetView(rtvHandle, clearColor, 0, nullptr);

    // Render the particles.
    float viewportHeight = static_cast<float>(static_cast<UINT>(m_viewport.Height) / m_heightInstances);
    float viewportWidth = static_cast<float>(static_cast<UINT>(m_viewport.Width) / m_widthInstances);
    for (UINT n = 0; n < ThreadCount; n++)
    {
        const UINT srvIndex = n + (m_srvIndex[n] == 0 ? SrvParticlePosVelo0 : SrvParticlePosVelo1);

        D3D12_VIEWPORT viewport;
        viewport.TopLeftX = (n % m_widthInstances) * viewportWidth;
        viewport.TopLeftY = (n / m_widthInstances) * viewportHeight;
        viewport.Width = viewportWidth;
        viewport.Height = viewportHeight;
        viewport.MinDepth = D3D12_MIN_DEPTH;
        viewport.MaxDepth = D3D12_MAX_DEPTH;
        m_commandList->RSSetViewports(1, &viewport);

        CD3DX12_GPU_DESCRIPTOR_HANDLE srvHandle(m_srvUavHeap->GetGPUDescriptorHandleForHeapStart(), srvIndex, m_srvUavDescriptorSize);
        m_commandList->SetGraphicsRootDescriptorTable(RootParameterSRV, srvHandle);

        m_commandList->DrawInstanced(ParticleCount, 1, 0, 0);
    }

    m_commandList->RSSetViewports(1, &m_viewport);

    // Indicate that the back buffer will now be used to present.
    m_commandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(m_renderTargets[m_frameIndex].Get(), D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PRESENT));

    ThrowIfFailed(m_commandList->Close());
}

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

요구 사항

요구 사항
대상 플랫폼 Windows
헤더 d3d12.h

참고 항목

Core 인터페이스

ID3D12CommandList

ID3D12GraphicsCommandList1