Navigation
API > API/Runtime > API/Runtime/RHI
RHI Descriptor Range - Experimental feature, these types may completely change in the future.
Abstraction around allocating a contiguous range of descriptors and loading them in shaders. The descriptor range will manage updating the platform specific bindless descriptor heap with its resources. When bound to a shader, the offset into the bindless descriptor heap will be available in the shader.
Type Mask Due to limitations on certain platforms, not all resource/view types can be in the same descriptor range. The types that can be used together are exposed via 'GRHIGlobals.DescriptorTypeGroups'. Each element in the DescriptorTypeGroups array corresponds to a set of descriptor types (via mask) that can be used together. Given how nuanced some of the descriptor types are, this may create friction in some uses of descriptor ranges.
To make type mask support easier, consider using different descriptor ranges for read-only vs read-write resources.
Resource Lifetimes The Descriptor Range will keep the resources assigned to it alive until the descriptor range is destroyed.
Support checks for this feature: Shader support: FDataDrivenShaderPlatformInfo::GetSupportsDescriptorRange Shader define: PLATFORM_SUPPORTS_DESCRIPTOR_RANGE Runtime: GRHIGlobals.bSupportsDescriptorRange (These must be checked in addition to the normal bindless checks)
Creation: FRHIDescriptorRangeDesc Desc{ Count, TypeMask }; TArray
Updating: TArray
Shader binding: SHADER_PARAMETER_DESCRIPTOR_RANGE(FDescriptorRange, DescriptorRange)
Shader access: Texture2D MyTexture = GetDescriptorRangeSRV(Texture2D, DescriptorRange, Offset);
| Name | FRHIDescriptorRangeDesc |
| Type | struct |
| Header File | /Engine/Source/Runtime/RHI/Public/RHIDescriptorRange.h |
| Include Path | #include "RHIDescriptorRange.h" |
Syntax
struct FRHIDescriptorRangeDesc
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Count | uint32 | Number of descriptors in the range. | RHIDescriptorRange.h | |
| TypeMask | ERHIDescriptorTypeMask | Mask of different descriptor types in the range. Types cannot cross groups exposed in GRHIGlobals.DescriptorTypeGroups. | RHIDescriptorRange.h |