The Joe Engine
Joe's engine programming playground
JoeEngine::JEVulkanDescriptor Class Reference

The JEVulkanDescriptor class. More...

#include <VulkanDescriptor.h>

Public Member Functions

 JEVulkanDescriptor ()=delete
 Default constructor (deleted). More...
 
 JEVulkanDescriptor (VkPhysicalDevice physicalDevice, VkDevice device, uint32_t numSwapChainImages, const std::vector< std::vector< VkImageView >> &imageViews, const std::vector< VkSampler > &samplers, const std::vector< uint32_t > &bufferSizes, const std::vector< uint32_t > &ssboSizes, VkDescriptorSetLayout descSetLayout, PipelineType type)
 Constructor. More...
 
 ~JEVulkanDescriptor ()=default
 Destructor (default). More...
 
void Cleanup (VkDevice device)
 
void BindDescriptorSets (VkCommandBuffer commandBuffer, VkPipelineLayout pipelineLayout, uint32_t descrSetIndex, uint32_t imageIndex) const
 Bind descriptor sets. More...
 
void UpdateDescriptorSets (VkDevice device, uint32_t imageIndex, const std::vector< const void * > &buffers, const std::vector< uint32_t > &bufferSizes, const std::vector< const void * > &ssboBuffers, const std::vector< uint32_t > &ssboSizes)
 Update descriptor sets. More...
 

Detailed Description

The JEVulkanDescriptor class.

Class that manages descriptor sets and device memory buffers for materials in the Joe Engine.

Constructor & Destructor Documentation

◆ JEVulkanDescriptor() [1/2]

JoeEngine::JEVulkanDescriptor::JEVulkanDescriptor ( )
delete

Default constructor (deleted).

◆ JEVulkanDescriptor() [2/2]

JoeEngine::JEVulkanDescriptor::JEVulkanDescriptor ( VkPhysicalDevice  physicalDevice,
VkDevice  device,
uint32_t  numSwapChainImages,
const std::vector< std::vector< VkImageView >> &  imageViews,
const std::vector< VkSampler > &  samplers,
const std::vector< uint32_t > &  bufferSizes,
const std::vector< uint32_t > &  ssboSizes,
VkDescriptorSetLayout  descSetLayout,
PipelineType  type 
)
inline

Constructor.

Creates all necessary Vulkan descriptor objects (pool and sets) and allocates all necessary buffer objects.

◆ ~JEVulkanDescriptor()

JoeEngine::JEVulkanDescriptor::~JEVulkanDescriptor ( )
default

Destructor (default).

Member Function Documentation

◆ BindDescriptorSets()

void JoeEngine::JEVulkanDescriptor::BindDescriptorSets ( VkCommandBuffer  commandBuffer,
VkPipelineLayout  pipelineLayout,
uint32_t  descrSetIndex,
uint32_t  imageIndex 
) const
inline

Bind descriptor sets.

Binds the specified descriptor set. Called during command buffer recording.

Parameters
commandBufferthe command buffer to record the bind command to.
pipelineLayoutthe pipeline layout for the descriptor set.
descrSetIndexthe specific descriptor set index to bind.
imageIndexthe currently active swap chain image index.

◆ Cleanup()

void JoeEngine::JEVulkanDescriptor::Cleanup ( VkDevice  device)

Cleanup all Vulkan objects and memory.

Parameters
devicethe Vulkan logical device to clean up with.

◆ UpdateDescriptorSets()

void JoeEngine::JEVulkanDescriptor::UpdateDescriptorSets ( VkDevice  device,
uint32_t  imageIndex,
const std::vector< const void * > &  buffers,
const std::vector< uint32_t > &  bufferSizes,
const std::vector< const void * > &  ssboBuffers,
const std::vector< uint32_t > &  ssboSizes 
)

Update descriptor sets.

Updates all descriptor set uniform and shader storage memory buffers to the data provided.

Parameters
devicethe Vulkan logical device.
imageIndexthe currently active swap chain image index.
bufferslist of new uniform buffer data to copy to the GPU.
bufferSizessize of each element in the parameter 'buffers'.
ssboBufferslist of new shader storage buffer data to copy to the GPU.
ssboSizessize of each element in the parameter 'ssboBuffers'.

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