Interfaccia ID3D12GraphicsCommandList (d3d12.h)

Incapsula un elenco di comandi grafici per il rendering. Include le API per instrumentare l'esecuzione dell'elenco di comandi e per impostare e cancellare lo stato della pipeline.

Nota La versione più recente di questa interfaccia è ID3D12GraphicsCommandList1 introdotta nella Windows 10 Creators Update. Le applicazioni destinate Windows 10 Creators Update devono usare l'interfaccia ID3D12GraphicsCommandList1 anziché ID3D12GraphicsCommandList.
 

Ereditarietà

L'interfaccia ID3D12GraphicsCommandList eredita da ID3D12CommandList. ID3D12GraphicsCommandList include anche questi tipi di membri:

Metodi

L'interfaccia ID3D12GraphicsCommandList include questi metodi.

 
ID3D12GraphicsCommandList::BeginEvent

Non deve essere chiamato direttamente.  Usare il runtime di eventi PIX per inserire eventi in un elenco di comandi. (ID3D12GraphicsCommandList.BeginEvent)
ID3D12GraphicsCommandList::BeginQuery

Avvia una query in esecuzione. (ID3D12GraphicsCommandList.BeginQuery)
ID3D12GraphicsCommandList::ClearDepthStencilView

Cancella la risorsa depth-stencil. (ID3D12GraphicsCommandList.ClearDepthStencilView)
ID3D12GraphicsCommandList::ClearRenderTargetView

Imposta tutti gli elementi di una destinazione di rendering su un valore.
ID3D12GraphicsCommandList::ClearState

Reimposta lo stato di un elenco di comandi diretti sullo stato in cui si trovava quando è stato creato l'elenco di comandi. (ID3D12GraphicsCommandList.ClearState)
ID3D12GraphicsCommandList::ClearUnorderedAccessViewFloat

Imposta tutti gli elementi in una visualizzazione di accesso non ordinato ai valori float specificati.
ID3D12GraphicsCommandList::ClearUnorderedAccessViewUint

Imposta tutti gli elementi in una visualizzazione di accesso non ordinato (UAV) sui valori integer specificati.
ID3D12GraphicsCommandList::Close

Indica che la registrazione nell'elenco dei comandi è stata completata. (ID3D12GraphicsCommandList.Close)
ID3D12GraphicsCommandList::CopyBufferRegion

Copia un'area di un buffer da una risorsa a un'altra.
ID3D12GraphicsCommandList::CopyResource

Copia l'intero contenuto della risorsa di origine nella risorsa di destinazione.
ID3D12GraphicsCommandList::CopyTextureRegion

Questo metodo usa la GPU per copiare i dati delle trame tra due posizioni. Sia l'origine che la destinazione possono fare riferimento ai dati delle trame che si trovano all'interno di una risorsa buffer o di una risorsa trama.
ID3D12GraphicsCommandList::CopyTiles

Copia i riquadri dal buffer alla risorsa affiancata o viceversa. (ID3D12GraphicsCommandList.CopyTiles)
ID3D12GraphicsCommandList::D iscardResource

Rimuove una risorsa.
ID3D12GraphicsCommandList::D ispatch

Esegue uno shader di calcolo in un gruppo di thread.
ID3D12GraphicsCommandList::D rawIndexedInstanced

Disegna primitive indicizzate e istanze.
ID3D12GraphicsCommandList::D rawInstanced

Disegna primitive non indicizzate e istanze.
ID3D12GraphicsCommandList::EndEvent

Non deve essere chiamato direttamente.  Usare il runtime di eventi PIX per inserire eventi in un elenco di comandi. (ID3D12GraphicsCommandList.EndEvent)
ID3D12GraphicsCommandList::EndQuery

Termina una query in esecuzione.
ID3D12GraphicsCommandList::ExecuteBundle

Esegue un bundle.
ID3D12GraphicsCommandList::ExecuteIndirect

Le app eseguono estrazioni/invii indiretti usando il metodo ExecuteIndirect.
ID3D12GraphicsCommandList::IASetIndexBuffer

Imposta la vista per il buffer di indice.
ID3D12GraphicsCommandList::IASetPrimitiveTopology

Associare informazioni sul tipo primitivo e sull'ordine dei dati che descrivono i dati di input per la fase dell'assembler di input. (ID3D12GraphicsCommandList.IASetPrimitiveTopology)
ID3D12GraphicsCommandList::IASetVertexBuffers

Imposta un handle del descrittore della CPU per i vertex buffer.
ID3D12GraphicsCommandList::OMSetBlendFactor

Imposta il fattore di fusione che modula i valori per un pixel shader, la destinazione di rendering o entrambi.
ID3D12GraphicsCommandList::OMSetRenderTargets

Imposta gli handle del descrittore della CPU per le destinazioni di rendering e lo stencil di profondità.
ID3D12GraphicsCommandList::OMSetStencilRef

Imposta il valore di riferimento per i test dello stencil di profondità.
ID3D12GraphicsCommandList::Reset

Ripristina lo stato iniziale di un elenco di comandi come se fosse stato appena creato un nuovo elenco di comandi. (ID3D12GraphicsCommandList.Reset)
ID3D12GraphicsCommandList::ResolveQueryData

Estrae i dati da una query. ResolveQueryData funziona con tutti i tipi heap (impostazione predefinita, caricamento e readback).  ResolveQueryData funziona con tutti i tipi heap (impostazione predefinita, caricamento e readback). .
ID3D12GraphicsCommandList::ResolveSubresource

Copiare una risorsa multi sampled in una risorsa non a campionamento multipla.
ID3D12GraphicsCommandList::ResourceBarrier

Notifica al driver che deve sincronizzare più accessi alle risorse. (ID3D12GraphicsCommandList.ResourceBarrier)
ID3D12GraphicsCommandList::RSSetScissorRects

Associa una matrice di rettangoli di scissor alla fase di rasterizzazione.
ID3D12GraphicsCommandList::RSSetViewports

Associare una matrice di viewport alla fase di rasterizzazione della pipeline. (ID3D12GraphicsCommandList.RSSetViewports)
ID3D12GraphicsCommandList::SetComputeRoot32BitConstant

Imposta una costante nella firma radice di calcolo.
ID3D12GraphicsCommandList::SetComputeRoot32BitConstants

Imposta un gruppo di costanti nella firma radice di calcolo.
ID3D12GraphicsCommandList::SetComputeRootConstantBufferView

Imposta un handle del descrittore della CPU per il buffer costante nella firma radice di calcolo.
ID3D12GraphicsCommandList::SetComputeRootDescriptorTable

Imposta una tabella descrittore nella firma radice di calcolo.
ID3D12GraphicsCommandList::SetComputeRootShaderResourceView

Imposta un handle descrittore CPU per la risorsa shader nella firma radice di calcolo.
ID3D12GraphicsCommandList::SetComputeRootSignature

Imposta il layout della firma radice di calcolo.
ID3D12GraphicsCommandList::SetComputeRootUnorderedAccessView

Imposta un handle descrittore DELLA CPU per la risorsa di visualizzazione di accesso non ordinata nella firma radice di calcolo.
ID3D12GraphicsCommandList::SetDescriptorHeaps

Modifica l'heaps descrittore attualmente associato a un elenco di comandi.
ID3D12GraphicsCommandList::SetGraphicsRoot32BitConstant

Imposta una costante nella firma radice grafica.
ID3D12GraphicsCommandList::SetGraphicsRoot32BitConstants

Imposta un gruppo di costanti nella firma radice grafica.
ID3D12GraphicsCommandList::SetGraphicsRootConstantBufferView

Imposta un handle descrittore CPU per il buffer costante nella firma radice grafica.
ID3D12GraphicsCommandList::SetGraphicsRootDescriptorTable

Imposta una tabella descrittore nella firma radice grafica.
ID3D12GraphicsCommandList::SetGraphicsRootShaderResourceView

Imposta un handle descrittore CPU per la risorsa shader nella firma radice grafica.
ID3D12GraphicsCommandList::SetGraphicsRootSignature

Imposta il layout della firma radice grafica.
ID3D12GraphicsCommandList::SetGraphicsRootUnorderedAccessView

Imposta un handle descrittore DELLA CPU per la risorsa vista di accesso non ordinata nella firma radice grafica.
ID3D12GraphicsCommandList::SetMarker

Non deve essere chiamato direttamente.  Usare il runtime di eventi PIX per inserire gli eventi in un elenco di comandi. (ID3D12GraphicsCommandList.SetMarker)
ID3D12GraphicsCommandList::SetPipelineState

Imposta tutti gli shader e i programmi la maggior parte dello stato predefinito della pipeline dell'unità di elaborazione grafica (GPU).
ID3D12GraphicsCommandList::SetPredication

Imposta un predicato di rendering.
ID3D12GraphicsCommandList::SOSetTargets

Imposta le visualizzazioni del buffer di output del flusso.

Commenti

Questa interfaccia è nuova a D3D12, incapsulando gran parte delle funzionalità dell'interfaccia ID3D11CommandList e includendo le nuove funzionalità descritte in Rendering.

Esempio

L'esempio D3D12nBodyGravity usa ID3D12GraphicsCommandList come indicato di seguito:

Dichiarare gli oggetti della pipeline.

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;

Popolamento degli elenchi di comandi.

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

Fare riferimento al codice di esempio nel riferimento D3D12.

Requisiti

Requisito Valore
Piattaforma di destinazione Windows
Intestazione d3d12.h

Vedi anche

Interfacce di base

ID3D12CommandList

ID3D12GraphicsCommandList1