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

Vulkan implementation of IDescriptorSet. More...

#include <VulkanDescriptorSet.h>

Inheritance diagram for spark::render::vk::VulkanDescriptorSet:
spark::render::DescriptorSet< IVulkanBuffer, IVulkanImage, IVulkanSampler > spark::render::Resource< VkDescriptorSet > spark::render::IDescriptorSet spark::render::IResource< VkDescriptorSet >

Classes

struct  Impl
 

Public Member Functions

 VulkanDescriptorSet (const VulkanDescriptorSetLayout &layout, VkDescriptorSet descriptor_set)
 Initializes a new VulkanDescriptorSet.
 
 VulkanDescriptorSet (const VulkanDescriptorSet &other)=delete
 
 VulkanDescriptorSet (VulkanDescriptorSet &&other) noexcept=delete
 
VulkanDescriptorSetoperator= (const VulkanDescriptorSet &other)=delete
 
VulkanDescriptorSetoperator= (VulkanDescriptorSet &&other) noexcept=delete
 
const VulkanDescriptorSetLayoutlayout () const noexcept
 Gets the parent VulkanDescriptorSetLayout.
 
void update (unsigned binding, const IVulkanBuffer &buffer, unsigned buffer_element, unsigned elements, unsigned first_descriptor) const override
 Updates a constant buffer within the IDescriptorSet.
 
void update (unsigned binding, const IVulkanImage &texture, unsigned descriptor, unsigned first_level, unsigned levels, unsigned first_layer, unsigned layers) const override
 Updates a constant buffer within the IDescriptorSet.
 
void update (unsigned binding, const IVulkanSampler &sampler, unsigned descriptor) const override
 Updates a constant buffer within the IDescriptorSet.
 
void attach (unsigned binding, const IVulkanImage &image) const override
 Attaches an image as an input attachment to a descriptor bound at binding.
 
- Public Member Functions inherited from spark::render::DescriptorSet< IVulkanBuffer, IVulkanImage, IVulkanSampler >
virtual void update (unsigned int binding, const buffer_type &buffer, unsigned int buffer_element=0, unsigned int elements=0, unsigned int first_descriptor=0) const=0
 Updates a constant buffer within the IDescriptorSet.
 
virtual void update (unsigned int binding, const image_type &texture, unsigned int descriptor=0, unsigned int first_level=0, unsigned int levels=0, unsigned int first_layer=0, unsigned int layers=0) const=0
 Updates a constant buffer within the IDescriptorSet.
 
virtual void update (unsigned int binding, const sampler_type &sampler, unsigned int descriptor=0) const=0
 Updates a constant buffer within the IDescriptorSet.
 
virtual void attach (unsigned int binding, const image_type &image) const=0
 Attaches an image as an input attachment to a descriptor bound at binding.
 
- Public Member Functions inherited from spark::render::IDescriptorSet
void update (unsigned int binding, const IBuffer &buffer, unsigned int buffer_element=0, unsigned int elements=0, unsigned int first_descriptor=0) const
 Updates a constant buffer within the IDescriptorSet.
 
void update (unsigned int binding, const IImage &texture, unsigned int descriptor=0, unsigned int first_level=0, unsigned int levels=0, unsigned int first_layer=0, unsigned int layers=0) const
 Updates a texture within the current descriptor set.
 
void update (unsigned int binding, const ISampler &sampler, unsigned int descriptor=0) const
 Updates a sampler within the current descriptor set.
 
void attach (unsigned int binding, const IImage &image) const
 Attaches an image as an input attachment to a descriptor bound at binding.
 
- Public Member Functions inherited from spark::render::Resource< VkDescriptorSet >
 Resource (VkDescriptorSet handle) noexcept
 Initializes the managed resource with the given handle.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other) noexcept=delete
 
Resourceoperator= (const Resource &other)=delete
 
Resourceoperator= (Resource &&other) noexcept=delete
 
const VkDescriptorSet & handle () const final
 Gets the managed resource handle.
 

Additional Inherited Members

- Public Types inherited from spark::render::DescriptorSet< IVulkanBuffer, IVulkanImage, IVulkanSampler >
using buffer_type
 
using image_type
 
using sampler_type
 
- Public Types inherited from spark::render::IResource< VkDescriptorSet >
using handle_type
 
- Protected Member Functions inherited from spark::render::Resource< VkDescriptorSet >
VkDescriptorSet & handle () final
 Gets the managed resource handle.
 

Detailed Description

Vulkan implementation of IDescriptorSet.

Constructor & Destructor Documentation

◆ VulkanDescriptorSet()

spark::render::vk::VulkanDescriptorSet::VulkanDescriptorSet ( const VulkanDescriptorSetLayout & layout,
VkDescriptorSet descriptor_set )
explicit

Initializes a new VulkanDescriptorSet.

Parameters
layoutThe parent VulkanDescriptorSetLayout.
descriptor_setThe descriptor set handle.
Exceptions
base::NullPointerExceptionif descriptor_set is nullptr.

Member Function Documentation

◆ attach()

void spark::render::vk::VulkanDescriptorSet::attach ( unsigned binding,
const IVulkanImage & image ) const
override

Attaches an image as an input attachment to a descriptor bound at binding.

Parameters
bindingThe input attachment binding point.
imageThe image to bind to the input attachment descriptor.

◆ layout()

const VulkanDescriptorSetLayout & spark::render::vk::VulkanDescriptorSet::layout ( ) const
nodiscardnoexcept

Gets the parent VulkanDescriptorSetLayout.

Returns
The parent VulkanDescriptorSetLayout.

◆ update() [1/3]

void spark::render::vk::VulkanDescriptorSet::update ( unsigned binding,
const IVulkanBuffer & buffer,
unsigned buffer_element,
unsigned elements,
unsigned first_descriptor ) const
override

Updates a constant buffer within the IDescriptorSet.

Parameters
bindingThe buffer binding point.
bufferThe constant buffer to write to the IDescriptorSet.
buffer_elementThe index of the first element to write to the IDescriptorSet.
elementsThe number of elements to write to the IDescriptorSet, or 0 to write all elements starting from buffer_element.
first_descriptorThe index of the first descriptor in the descriptor array to update.

◆ update() [2/3]

void spark::render::vk::VulkanDescriptorSet::update ( unsigned binding,
const IVulkanImage & texture,
unsigned descriptor,
unsigned first_level,
unsigned levels,
unsigned first_layer,
unsigned layers ) const
override

Updates a constant buffer within the IDescriptorSet.

Parameters
bindingThe buffer binding point.
bufferThe constant buffer to write to the IDescriptorSet.
buffer_elementThe index of the first element to write to the IDescriptorSet.
elementsThe number of elements to write to the IDescriptorSet, or 0 to write all elements starting from buffer_element.
first_descriptorThe index of the first descriptor in the descriptor array to update.

◆ update() [3/3]

void spark::render::vk::VulkanDescriptorSet::update ( unsigned binding,
const IVulkanSampler & sampler,
unsigned descriptor ) const
override

Updates a constant buffer within the IDescriptorSet.

Parameters
bindingThe buffer binding point.
bufferThe constant buffer to write to the IDescriptorSet.
buffer_elementThe index of the first element to write to the IDescriptorSet.
elementsThe number of elements to write to the IDescriptorSet, or 0 to write all elements starting from buffer_element.
first_descriptorThe index of the first descriptor in the descriptor array to update.