Raven Engine v0.1
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
void Init (RenderPassSpecification *spec)
 Initializes the manager with a render pass specification.
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.
void SetInput (const Ref< Texture2D > &texture, std::string_view imageName, std::string_view samplerName)
 Adds a texture input by reference, associating it with image and sampler binding names.
void Bake ()
 Finalizes and uploads all descriptor sets to the GPU.

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.

◆ Init()

void Raven::DescriptorSetManager::Init ( RenderPassSpecification * spec)

Initializes the manager with a render pass specification.

Must be called before setting inputs or baking descriptor sets.

Parameters
specPointer to the render pass specification to use.

◆ SetInput() [1/2]

void Raven::DescriptorSetManager::SetInput ( const Ref< Texture2D > & texture,
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() [2/2]

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.

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