Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::DX12::DescriptorContext Class Reference

Manages pools of descriptors. More...

#include <DescriptorContext.h>

Public Member Functions

 AZ_CLASS_ALLOCATOR (DescriptorContext, AZ::SystemAllocator)
 
void Init (ID3D12DeviceX *device, RHI::ConstPtr< PlatformLimitsDescriptor > platformLimitsDescriptor)
 
void CreateConstantBufferView (const Buffer &buffer, const RHI::BufferViewDescriptor &bufferViewDescriptor, DescriptorHandle &constantBufferView, DescriptorHandle &staticView)
 
void CreateShaderResourceView (const Buffer &buffer, const RHI::BufferViewDescriptor &bufferViewDescriptor, DescriptorHandle &shaderResourceView, DescriptorHandle &staticView)
 
void CreateUnorderedAccessView (const Buffer &buffer, const RHI::BufferViewDescriptor &bufferViewDescriptor, DescriptorHandle &unorderedAccessView, DescriptorHandle &unorderedAccessViewClear, DescriptorHandle &staticView)
 
void CreateShaderResourceView (const Image &image, const RHI::ImageViewDescriptor &imageViewDescriptor, DescriptorHandle &shaderResourceView, DescriptorHandle &staticView)
 
void CreateUnorderedAccessView (const Image &image, const RHI::ImageViewDescriptor &imageViewDescriptor, DescriptorHandle &unorderedAccessView, DescriptorHandle &unorderedAccessViewClear, DescriptorHandle &staticView)
 
void CreateRenderTargetView (const Image &image, const RHI::ImageViewDescriptor &imageViewDescriptor, DescriptorHandle &renderTargetView)
 
void CreateDepthStencilView (const Image &image, const RHI::ImageViewDescriptor &imageViewDescriptor, DescriptorHandle &depthStencilView, DescriptorHandle &depthStencilReadView)
 
void CreateSampler (const RHI::SamplerState &samplerState, DescriptorHandle &samplerHandle)
 
void ReleaseDescriptor (DescriptorHandle descriptorHandle)
 
void ReleaseStaticDescriptor (DescriptorHandle index)
 
DescriptorTable CreateDescriptorTable (D3D12_DESCRIPTOR_HEAP_TYPE descriptorHeapType, uint32_t descriptorCount)
 
D3D12_GPU_DESCRIPTOR_HANDLE GetBindlessGpuPlatformHandle () const
 Retrieve a descriptor handle to the start of the static region of the shader-visible CBV_SRV_UAV heap.
 
void ReleaseDescriptorTable (DescriptorTable descriptorTable)
 
void UpdateDescriptorTableRange (DescriptorTable gpuDestinationTable, const DescriptorHandle *cpuSourceDescriptors, D3D12_DESCRIPTOR_HEAP_TYPE heapType)
 
DescriptorHandle GetNullHandleSRV (D3D12_SRV_DIMENSION dimension) const
 
DescriptorHandle GetNullHandleUAV (D3D12_UAV_DIMENSION dimension) const
 
DescriptorHandle GetNullHandleCBV () const
 
DescriptorHandle GetNullHandleSampler () const
 
D3D12_CPU_DESCRIPTOR_HANDLE GetCpuPlatformHandle (DescriptorHandle handle) const
 
D3D12_GPU_DESCRIPTOR_HANDLE GetGpuPlatformHandle (DescriptorHandle handle) const
 
D3D12_CPU_DESCRIPTOR_HANDLE GetCpuPlatformHandleForTable (DescriptorTable descTable) const
 
D3D12_GPU_DESCRIPTOR_HANDLE GetGpuPlatformHandleForTable (DescriptorTable descTable) const
 
void SetDescriptorHeaps (ID3D12GraphicsCommandList *commandList) const
 
void GarbageCollect ()
 
ID3D12DeviceX * GetDevice ()
 

Detailed Description

Manages pools of descriptors.

Member Function Documentation

◆ CreateDescriptorTable()

DescriptorTable AZ::DX12::DescriptorContext::CreateDescriptorTable ( D3D12_DESCRIPTOR_HEAP_TYPE  descriptorHeapType,
uint32_t  descriptorCount 
)

Creates a GPU-visible descriptor table.

Parameters
descriptorHeapTypeThe descriptor heap to allocate from.
descriptorCountThe number of descriptors to allocate.

◆ ReleaseDescriptorTable()

void AZ::DX12::DescriptorContext::ReleaseDescriptorTable ( DescriptorTable  descriptorTable)

Releases a GPU-visible descriptor table.

Parameters
descriptorHeapTypeThe descriptor heap to allocate from.

◆ UpdateDescriptorTableRange()

void AZ::DX12::DescriptorContext::UpdateDescriptorTableRange ( DescriptorTable  gpuDestinationTable,
const DescriptorHandle cpuSourceDescriptors,
D3D12_DESCRIPTOR_HEAP_TYPE  heapType 
)

Performs a gather of disjoint CPU-side descriptors and copies to a contiguous GPU-side descriptor table.

Parameters
gpuDestinationTableThe destination descriptor table that the descriptors will be uploaded to. This must be the table specifically for a given range of descriptors, so if the user created a table with multiple ranges, they are required to partition that table and call this method multiple times with each range partition.
cpuSourceDescriptorsThe CPU descriptors being gathered and copied to the destination table. The number of elements must match the size of the destination table.
heapTypeThe type of heap being updated.

The documentation for this class was generated from the following file: