Raven Engine v0.1
A modern 3D Game Engine
Loading...
Searching...
No Matches
Raven::DescriptorSetManager Class Reference

Manages Vulkan descriptor sets for a given render pass specification. More...

#include <DescriptorSetManager.h>

Public Member Functions

 DescriptorSetManager ()=default
 ~DescriptorSetManager ()=default
ILLUMINE_API void Init (Ref< Shader > shader)
 Initializes the manager with a render pass specification.
ILLUMINE_API void SetInput (const Ref< UniformBuffer > &uniformBuffer, std::string_view name)
 Adds a uniform buffer input by reference and associates it with a shader binding name.
ILLUMINE_API void SetInput (const Ref< Image2D > &image, std::string_view imageName, std::string_view samplerName)
 Adds a texture input by reference, associating it with image and sampler binding names.
ILLUMINE_API void SetInput (const Ref< Image2D > &image, std::string_view imageName)
ILLUMINE_API void SetInput (const Ref< TextureCube > &cubemap, std::string_view imageName, std::string_view samplerName)
ILLUMINE_API void SetInput (const Ref< StorageBuffer > &buffer, std::string_view name)
ILLUMINE_API void Bake ()
 Finalizes and uploads all descriptor sets to the GPU.
ILLUMINE_API const std::vector< VkDescriptorSet > & GetDescriptorSets () const
ILLUMINE_API void UpdateShader (Ref< Shader > shader)

Detailed Description

Manages Vulkan descriptor sets for a given render pass specification.

Handles the allocation, updating, and baking of descriptor sets based on uniform buffers and textures provided by the user. Internally tracks inputs and prepares Vulkan descriptor writes.

Constructor & Destructor Documentation

◆ DescriptorSetManager()

Raven::DescriptorSetManager::DescriptorSetManager ( )
default

◆ ~DescriptorSetManager()

Raven::DescriptorSetManager::~DescriptorSetManager ( )
default

Member Function Documentation

◆ Bake()

void Raven::DescriptorSetManager::Bake ( )

Finalizes and uploads all descriptor sets to the GPU.

This function performs Vulkan descriptor writes for all inputs added via SetInput. Must be called after all inputs are set.

◆ GetDescriptorSets()

ILLUMINE_API const std::vector< VkDescriptorSet > & Raven::DescriptorSetManager::GetDescriptorSets ( ) const
inline

◆ Init()

void Raven::DescriptorSetManager::Init ( Ref< Shader > shader)

Initializes the manager with a render pass specification.

Must be called before setting inputs or baking descriptor sets.

Parameters
shaderRef to the shader to use.

◆ SetInput() [1/5]

void Raven::DescriptorSetManager::SetInput ( const Ref< Image2D > & image,
std::string_view imageName )

◆ SetInput() [2/5]

void Raven::DescriptorSetManager::SetInput ( const Ref< Image2D > & image,
std::string_view imageName,
std::string_view samplerName )

Adds a texture input by reference, associating it with image and sampler binding names.

Parameters
textureReference to the texture.
imageNameShader image binding name.
samplerNameShader sampler binding name.

◆ SetInput() [3/5]

void Raven::DescriptorSetManager::SetInput ( const Ref< StorageBuffer > & buffer,
std::string_view name )

◆ SetInput() [4/5]

void Raven::DescriptorSetManager::SetInput ( const Ref< TextureCube > & cubemap,
std::string_view imageName,
std::string_view samplerName )

◆ SetInput() [5/5]

void Raven::DescriptorSetManager::SetInput ( const Ref< UniformBuffer > & uniformBuffer,
std::string_view name )

Adds a uniform buffer input by reference and associates it with a shader binding name.

Parameters
uniformBufferReference to the uniform buffer.
nameShader uniform name to bind this buffer to.

◆ UpdateShader()

ILLUMINE_API void Raven::DescriptorSetManager::UpdateShader ( Ref< Shader > shader)
inline

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