LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Rendering::DescriptorBinding Struct Reference

Describes a resource binding to a descriptor or descriptor set. More...

#include <rendering_api.hpp>

Public Types

using resource_container = Variant<std::monostate, Ref<const IBuffer>, Ref<const IImage>, Ref<const ISampler>, Ref<const IAccelerationStructure>>
 

Public Attributes

Optional< UInt32binding = std::nullopt
 The binding point to bind the resource at. If not provided (i.e., std::nullopt), the index within the collection of DescriptorBindings is used.
 
resource_container resource = {}
 The resource to bind or std::monostate if no resource should be bound.
 
UInt32 firstDescriptor = 0
 The index of the descriptor in a descriptor array at which binding the resource arrays starts.
 
UInt32 firstElement = 0
 The index of the first array element or image layer to bind, starting at firstDescriptor.
 
UInt32 elements = 0
 The number of array elements or image layers to bind, starting at firstDescriptor.
 
UInt32 firstLevel = 0
 If the resource is an image, this describes the first level to be bound.
 
UInt32 levels = 0
 If the resource is an image, this describes the number of levels to be bound.
 

Detailed Description

Describes a resource binding to a descriptor or descriptor set.

See also
IDescriptorSet, IDescriptorSetLayout

Member Typedef Documentation

◆ resource_container

Member Data Documentation

◆ binding

Optional<UInt32> LiteFX::Rendering::DescriptorBinding::binding = std::nullopt

The binding point to bind the resource at. If not provided (i.e., std::nullopt), the index within the collection of DescriptorBindings is used.

◆ elements

UInt32 LiteFX::Rendering::DescriptorBinding::elements = 0

The number of array elements or image layers to bind, starting at firstDescriptor.

This property is ignored, if the resource is a ISampler.

See also
firstDescriptor

◆ firstDescriptor

UInt32 LiteFX::Rendering::DescriptorBinding::firstDescriptor = 0

The index of the descriptor in a descriptor array at which binding the resource arrays starts.

If the resource contains an array, the individual elements (layers for images) will be bound, starting at this descriptor. The first element/layer to be bound is identified by firstElement. The number of elements/layers to be bound is stored in elements.

See also
firstElement, elements

◆ firstElement

UInt32 LiteFX::Rendering::DescriptorBinding::firstElement = 0

The index of the first array element or image layer to bind, starting at firstDescriptor.

This property is ignored, if the resource is a ISampler.

See also
firstDescriptor

◆ firstLevel

UInt32 LiteFX::Rendering::DescriptorBinding::firstLevel = 0

If the resource is an image, this describes the first level to be bound.

This property is ignored, if the resource is a ISampler or IBuffer.

◆ levels

UInt32 LiteFX::Rendering::DescriptorBinding::levels = 0

If the resource is an image, this describes the number of levels to be bound.

This property is ignored, if the resource is a ISampler or IBuffer.

◆ resource

resource_container LiteFX::Rendering::DescriptorBinding::resource = {}

The resource to bind or std::monostate if no resource should be bound.

Note that not providing any resource does not perform any binding, in which case a resource needs to be manually bound to the descriptor set later (IDescriptorSet::update). This is useful in situations where you frequently update the resource bound to a descriptor set or where you do no have access to the resource at the time the descriptor set is allocated.

See also
IBuffer, IImage, ISampler