|
Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
|
Manages the descriptor pool, descriptor layouts, and descriptor set allocations for UBO resources. More...
#include <VulkanDescriptors.hpp>
Public Member Functions | |
| VulkanDescriptors ()=default | |
| Construct a new Vulkan Descriptors object. | |
| ~VulkanDescriptors () | |
| Destroy the Vulkan Descriptors object and release descriptor resources. | |
| VulkanDescriptors (const VulkanDescriptors &)=delete | |
| VulkanDescriptors & | operator= (const VulkanDescriptors &)=delete |
| void | create (VkDevice device, uint32_t maxFramesInFlight=2) |
| Creates the descriptor pool. | |
| void | createCameraDescriptorSetLayout () |
| Creates descriptor set layouts defining resource bindings for camera. | |
| void | createTextureDescriptorSetLayout () |
| Creates descriptor set layout for texture samplers. | |
| void | createJointsDescriptorSetLayout () |
| Creates descriptor set layout for joints/bones matrices. | |
| void | allocateCameraDescriptorSets (VkBuffer uniformBuffer, VkDeviceSize bufferSize) |
| Allocates and binds descriptor sets for the camera UBO. | |
| void | allocateTextureDescriptorSet (VkDescriptorSet &descriptorSet, VkImageView diffuseView, VkSampler diffuseSampler, VkImageView normalView, VkSampler normalSampler, VkImageView metallicView, VkSampler metallicSampler) |
| Allocates and binds descriptor set for texture samplers (diffuse, normal, metallic). | |
| void | updateTextureDescriptorSet (VkDescriptorSet descriptorSet, VkImageView diffuseView, VkSampler diffuseSampler, VkImageView normalView, VkSampler normalSampler, VkImageView metallicView, VkSampler metallicSampler) |
| Updates an existing texture descriptor set with new sampler bindings. | |
| void | allocateJointsDescriptorSet (VkDescriptorSet &descriptorSet, VkBuffer uniformBuffer, VkDeviceSize range) |
| Allocates and binds descriptor set for a skeleton joint matrices buffer. | |
| void | destroy () |
| Safely destroys layout bindings and descriptor pools. | |
| VkDescriptorSetLayout | getCameraDescriptorSetLayout () const |
| Gets raw camera descriptor set layout. | |
| VkDescriptorSetLayout | getTextureDescriptorSetLayout () const |
| Gets raw texture descriptor set layout. | |
| VkDescriptorSetLayout | getJointsDescriptorSetLayout () const |
| Gets raw joints descriptor set layout. | |
| VkDescriptorSet | getCameraDescriptorSet () const |
| Gets raw camera descriptor set. | |
| VkDescriptorPool | getDescriptorPool () const |
| Gets raw descriptor pool. | |
Private Attributes | |
| VkDevice | device = VK_NULL_HANDLE |
| Reference to logical device. | |
| VkDescriptorPool | descriptorPool = VK_NULL_HANDLE |
| Descriptor pool allocator. | |
| VkDescriptorSetLayout | cameraDescriptorSetLayout = VK_NULL_HANDLE |
| Descriptor set layout allocated for camera. | |
| VkDescriptorSetLayout | textureDescriptorSetLayout = VK_NULL_HANDLE |
| Descriptor set layout allocated for textures. | |
| VkDescriptorSetLayout | jointsDescriptorSetLayout = VK_NULL_HANDLE |
| Descriptor set layout allocated for joints. | |
| VkDescriptorSet | cameraDescriptorSet = VK_NULL_HANDLE |
| Descriptor set allocated for camera. | |
Manages the descriptor pool, descriptor layouts, and descriptor set allocations for UBO resources.
|
default |
Construct a new Vulkan Descriptors object.
| VulkanDescriptors::~VulkanDescriptors | ( | ) |
Destroy the Vulkan Descriptors object and release descriptor resources.
Destroy the Vulkan Descriptors:: Vulkan Descriptors object.
|
delete |
| void VulkanDescriptors::allocateCameraDescriptorSets | ( | VkBuffer | uniformBuffer, |
| VkDeviceSize | bufferSize ) |
Allocates and binds descriptor sets for the camera UBO.
Allocates camera descriptor set and updates layout binding.
| uniformBuffer | The GPU buffer containing camera matrices. |
| bufferSize | Size of UBO buffer. |
| uniformBuffer | GPU uniform buffer handle. |
| bufferSize | Size of uniform buffer memory. |
| void VulkanDescriptors::allocateJointsDescriptorSet | ( | VkDescriptorSet & | descriptorSet, |
| VkBuffer | uniformBuffer, | ||
| VkDeviceSize | range ) |
Allocates and binds descriptor set for a skeleton joint matrices buffer.
Allocates joints descriptor set and updates binding with joint matrices uniform buffer.
| descriptorSet | Reference to target descriptor set to allocate. |
| uniformBuffer | GPU buffer. |
| range | Buffer segment size. |
| void VulkanDescriptors::allocateTextureDescriptorSet | ( | VkDescriptorSet & | descriptorSet, |
| VkImageView | diffuseView, | ||
| VkSampler | diffuseSampler, | ||
| VkImageView | normalView, | ||
| VkSampler | normalSampler, | ||
| VkImageView | metallicView, | ||
| VkSampler | metallicSampler ) |
Allocates and binds descriptor set for texture samplers (diffuse, normal, metallic).
| descriptorSet | Reference to target descriptor set to allocate. |
| diffuseView | Diffuse image view. |
| diffuseSampler | Diffuse sampler. |
| normalView | Normal map image view. |
| normalSampler | Normal map sampler. |
| metallicView | Metallic map image view. |
| metallicSampler | Metallic map sampler. |
| void VulkanDescriptors::create | ( | VkDevice | dev, |
| uint32_t | maxFramesInFlight = 2 ) |
Creates the descriptor pool.
Allocates and initializes the Vulkan descriptor pool.
| device | Vulkan logical device context. |
| maxFramesInFlight | Allocated size constraints for double-buffering. |
| dev | Logical device context. |
| void VulkanDescriptors::createCameraDescriptorSetLayout | ( | ) |
Creates descriptor set layouts defining resource bindings for camera.
Configures binding requirements and instantiates layout description.
| void VulkanDescriptors::createJointsDescriptorSetLayout | ( | ) |
Creates descriptor set layout for joints/bones matrices.
Configures binding requirements for joint matrices and instantiates layout description.
| void VulkanDescriptors::createTextureDescriptorSetLayout | ( | ) |
Creates descriptor set layout for texture samplers.
Configures binding requirements for texture samplers and instantiates layout description.
| void VulkanDescriptors::destroy | ( | ) |
Safely destroys layout bindings and descriptor pools.
Safely destroys descriptor pools and layouts.
|
inline |
Gets raw camera descriptor set.
|
inline |
Gets raw camera descriptor set layout.
|
inline |
Gets raw descriptor pool.
|
inline |
Gets raw joints descriptor set layout.
|
inline |
Gets raw texture descriptor set layout.
|
delete |
| void VulkanDescriptors::updateTextureDescriptorSet | ( | VkDescriptorSet | descriptorSet, |
| VkImageView | diffuseView, | ||
| VkSampler | diffuseSampler, | ||
| VkImageView | normalView, | ||
| VkSampler | normalSampler, | ||
| VkImageView | metallicView, | ||
| VkSampler | metallicSampler ) |
Updates an existing texture descriptor set with new sampler bindings.
|
private |
Descriptor set allocated for camera.
|
private |
Descriptor set layout allocated for camera.
|
private |
Descriptor pool allocator.
|
private |
Reference to logical device.
|
private |
Descriptor set layout allocated for joints.
|
private |
Descriptor set layout allocated for textures.