Lecture 13: Resources in DX12

Computer graphics in Game development

Ivan Belyavtsev

20.11.2020

Resource

Resource is any data in memory

  • Vertex buffer
  • Index buffer
  • Constant buffer
  • Texture
  • Depth/Stencil buffer [1]

Type of resources

  • Committed
  • Placed
  • Reserved [1]

Resource heap types

  • Default - no CPU access
  • Upload - CPU can write
  • Readback - CPU can read [1]

Resource descriptors

Resource descriptor is a properties of the particular resource.

  • CreateConstantBufferView
  • CreateDepthStencilView
  • CreateRenderTargetView
  • CreateShaderResourceView
  • CreateUnorderedAccessView [1]

Descriptor heaps

Descriptors heaps hold resource descriptors.

Types of descriptor heaps:

  • CBV, SRV, and UAV
  • SAMPLER
  • RTV
  • DSV [1]

Descriptor tables and root signature

Root signature links command lists to the resources the shaders require.

Descriptor table hold a range of descriptor heap which is going to be bound to the root signature [1]

Resource barriers

In DX12 the application is managing all resource states:

  • D3D12_RESOURCE_STATE_COMMON
  • D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER
  • D3D12_RESOURCE_STATE_INDEX_BUFFER
  • D3D12_RESOURCE_STATE_RENDER_TARGET
  • D3D12_RESOURCE_STATE_UNORDERED_ACCESS
  • D3D12_RESOURCE_STATE_DEPTH_WRITE
  • D3D12_RESOURCE_STATE_DEPTH_READ
  • D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE
  • D3D12_RESOURCE_STATE_COPY_DEST
  • D3D12_RESOURCE_STATE_COPY_SOURCE
  • D3D12_RESOURCE_STATE_PRESENT and others [1]

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