Lecture 13: Resources in DX12

Computer graphics in Game development

Ivan Belyavtsev

19.02.2021

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]

Lab: load_assets: vertex buffer and constant buffer

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]

Lab: load_pipeline: descriptor heaps

Resource barriers

In DX12 the application is managing all resource states:

  • D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER
  • D3D12_RESOURCE_STATE_RENDER_TARGET
  • 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