Lecture 14: Pipeline setup in DX12

Computer graphics in Game development

Ivan Belyavtsev

21.11.2020

Pipeline state object

PSO keeps a state of rendering pipeline:

  • Input layout
  • Root signature
  • Shaders bytecode
  • State of rasterizer
  • Blending state
  • Depth/stencil state [1]

Pipeline doesn’t keep

  • Vertex and index buffers
  • Primitive topology
  • Render target and depth buffer
  • Particular root signature, descriptor heaps and tables [1]

Command allocator

A region of memory to keep a queue GPU commands.

Has one method Reset, which allows to re-use the memory for the next commands [1]

Command queues

Command queue allows to submit commands via command list and make the fence synchronization

  • ExecuteCommandLists for submitting command lists
  • Signal for setting a special value to the fence [1]

Command lists

Command list a set of GPU command which will executed

  • Reset transfers the command list to the record state
  • Close transfers the command list out of the record state [1]

Synchronizations

Fence is an object of GPU-CPU synchronization [1]

command_queue->Signal(fence.Get(), prev_fence_value));

if (fence->GetCompletedValue() < prev_fence_value)
{
    //fence_event is a system handle for the fence
    ThrowIfFailed(fence->SetEventOnCompletion(prev_fence_value, fence_event));
    WaitForSingleObject(fence_event, INFINITE);
}

References

1.
Satran M. et al. Direct3D 12 programming guide [Electronic resource]. 2019. URL: https://docs.microsoft.com/en-us/windows/win32/direct3d12/directx-12-programming-guide.
// reveal.js plugins