SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::render::vk::VulkanDescriptorLayout Class Referencefinal

Implements a Vulkan IDescriptorLayout. More...

#include <VulkanDescriptorLayout.h>

Inheritance diagram for spark::render::vk::VulkanDescriptorLayout:
spark::render::IDescriptorLayout spark::render::IBufferLayout

Classes

struct  Impl
 

Public Member Functions

 VulkanDescriptorLayout (DescriptorType type, unsigned int binding, std::size_t element_size, unsigned int descriptors=1)
 Initializes a new Vulkan descriptor layout.
 
 VulkanDescriptorLayout (std::unique_ptr< IVulkanSampler > &&static_sampler, unsigned int binding)
 Initializes a new Vulkan descriptor layout for a static sampler.
 
 VulkanDescriptorLayout (const VulkanDescriptorLayout &other)=delete
 
 VulkanDescriptorLayout (VulkanDescriptorLayout &&other) noexcept=delete
 
VulkanDescriptorLayoutoperator= (const VulkanDescriptorLayout &other)=delete
 
VulkanDescriptorLayoutoperator= (VulkanDescriptorLayout &&other) noexcept=delete
 
std::size_t elementSize () const noexcept override
 Gets the size of a single element in the buffer.
 
unsigned binding () const noexcept override
 Gets the binding point the buffer will be bound to.
 
BufferType type () const noexcept override
 Gets the type of the buffer.
 
DescriptorType descriptorType () const noexcept override
 Gets the type of the descriptor.
 
unsigned descriptors () const noexcept override
 Gets the number of descriptors in the descriptor array, or 0xFFFFFFFF if the descriptor is unbounded.
 
const IVulkanSamplerstaticSampler () const noexcept override
 Gets the state of the sampler if it is a static sampler.
 

Detailed Description

Implements a Vulkan IDescriptorLayout.

Constructor & Destructor Documentation

◆ VulkanDescriptorLayout() [1/2]

spark::render::vk::VulkanDescriptorLayout::VulkanDescriptorLayout ( DescriptorType type,
unsigned int binding,
std::size_t element_size,
unsigned int descriptors = 1 )
explicit

Initializes a new Vulkan descriptor layout.

Parameters
typeThe type of the descriptor.
bindingThe binding point for the descriptor.
element_sizeThe size of the descriptor.
descriptorsThe number of descriptors in the array. If set to -1, the descriptor is unbounded.

◆ VulkanDescriptorLayout() [2/2]

spark::render::vk::VulkanDescriptorLayout::VulkanDescriptorLayout ( std::unique_ptr< IVulkanSampler > && static_sampler,
unsigned int binding )
explicit

Initializes a new Vulkan descriptor layout for a static sampler.

Parameters
static_samplerA std::unique_ptr to a VulkanSampler used to initialize the state with.
bindingThe binding point for the descriptor.

Member Function Documentation

◆ binding()

unsigned spark::render::vk::VulkanDescriptorLayout::binding ( ) const
nodiscardoverridevirtualnoexcept

Gets the binding point the buffer will be bound to.

Returns
The binding point the buffer will be bound to.

Implements spark::render::IBufferLayout.

◆ descriptors()

unsigned spark::render::vk::VulkanDescriptorLayout::descriptors ( ) const
nodiscardoverridevirtualnoexcept

Gets the number of descriptors in the descriptor array, or 0xFFFFFFFF if the descriptor is unbounded.

Returns
The number of descriptors in the descriptor array, or 0xFFFFFFFF if the descriptor is unbounded.
Note
If the descriptor is unbounded, the size of the array must be specified when allocating a IDescriptorSet using the descriptors parameter.

Implements spark::render::IDescriptorLayout.

◆ descriptorType()

DescriptorType spark::render::vk::VulkanDescriptorLayout::descriptorType ( ) const
nodiscardoverridevirtualnoexcept

Gets the type of the descriptor.

Returns
A DescriptorType representing the type of the descriptor.

Implements spark::render::IDescriptorLayout.

◆ elementSize()

std::size_t spark::render::vk::VulkanDescriptorLayout::elementSize ( ) const
nodiscardoverridevirtualnoexcept

Gets the size of a single element in the buffer.

Returns
The size of a single element in the buffer.

Implements spark::render::IBufferLayout.

◆ staticSampler()

const IVulkanSampler * spark::render::vk::VulkanDescriptorLayout::staticSampler ( ) const
nodiscardoverridevirtualnoexcept

Gets the state of the sampler if it is a static sampler.

Returns
A pointer to ISampler containing the state of the sampler if the descriptor is a static sampler, or nullptr if the descriptor is not a static sampler.

Implements spark::render::IDescriptorLayout.

◆ type()

BufferType spark::render::vk::VulkanDescriptorLayout::type ( ) const
nodiscardoverridevirtualnoexcept

Gets the type of the buffer.

Returns
A BufferType representing the type of the buffer.

Implements spark::render::IBufferLayout.