Vulkan2D
2D renderer written in C using Vulkan and SDL2
Loading...
Searching...
No Matches
DescriptorControl.h File Reference

Makes dynamic descriptor control simpler. More...

#include "VK2D/Structs.h"
Include dependency graph for DescriptorControl.h:

Go to the source code of this file.

Functions

VK2DDescCon vk2dDescConCreate (VK2DLogicalDevice dev, VkDescriptorSetLayout layout, uint32_t buffer, uint32_t sampler, uint32_t storageBuffer)
 Creates an empty descriptor controller.
 
void vk2dDescConUpdateAfterBind (VK2DDescCon descCon)
 Tells the desc con to allocate pools with update after bind.
 
void vk2dDescConFree (VK2DDescCon descCon)
 Frees a descriptor controller from memory.
 
VkDescriptorSet vk2dDescConGetBufferSet (VK2DDescCon descCon, VK2DBuffer buffer)
 Creates, updates, and returns a descriptor set ready to be bound to a command buffer.
 
VkDescriptorSet vk2dDescConGetSet (VK2DDescCon descCon)
 Creates, updates, and returns a blank descriptor set.
 
VkDescriptorSet vk2dDescConGetSamplerSet (VK2DDescCon descCon, VK2DTexture tex)
 Creates, updates, and returns a descriptor set ready to be bound to a command buffer.
 
VkDescriptorSet vk2dDescConGetSamplerBufferSet (VK2DDescCon descCon, VK2DTexture tex, VK2DBuffer buffer)
 Creates, updates, and returns a descriptor set ready to be bound to a command buffer.
 
void vk2dDescConReset (VK2DDescCon descCon)
 Resets all pools in a descriptor controller (basically deletes all active sets so new ones can be allocated)
 

Detailed Description

Makes dynamic descriptor control simpler.

Author
Paolo Mazzon

Function Documentation

◆ vk2dDescConCreate()

VK2DDescCon vk2dDescConCreate ( VK2DLogicalDevice  dev,
VkDescriptorSetLayout  layout,
uint32_t  buffer,
uint32_t  sampler,
uint32_t  storageBuffer 
)

Creates an empty descriptor controller.

Parameters
layoutDescriptor set layout to use
bufferLocation of the buffer or VK2D_NO_LOCATION if unused (binding)
samplerLocation of the sampler or VK2D_NO_LOCATION if unused (binding)
Returns
New descriptor controller or NULL if it failed

◆ vk2dDescConFree()

void vk2dDescConFree ( VK2DDescCon  descCon)

Frees a descriptor controller from memory.

Parameters
descConDescriptor controller to free

◆ vk2dDescConGetBufferSet()

VkDescriptorSet vk2dDescConGetBufferSet ( VK2DDescCon  descCon,
VK2DBuffer  buffer 
)

Creates, updates, and returns a descriptor set ready to be bound to a command buffer.

Parameters
descConDescriptor controller to pull the set from
bufferBuffer to bind to the descriptor set
Returns
Returns a new descriptor set ready to be bound to a command buffer (valid until vk2dDescConReset is called)

◆ vk2dDescConGetSamplerBufferSet()

VkDescriptorSet vk2dDescConGetSamplerBufferSet ( VK2DDescCon  descCon,
VK2DTexture  tex,
VK2DBuffer  buffer 
)

Creates, updates, and returns a descriptor set ready to be bound to a command buffer.

Parameters
descConDescriptor controller to pull the set from
texTexture to bind to the descriptor set
bufferBuffer to bind to the descriptor set
Returns
Returns a new descriptor set ready to be bound to a command buffer (valid until vk2dDescConReset is called)

◆ vk2dDescConGetSamplerSet()

VkDescriptorSet vk2dDescConGetSamplerSet ( VK2DDescCon  descCon,
VK2DTexture  tex 
)

Creates, updates, and returns a descriptor set ready to be bound to a command buffer.

Parameters
descConDescriptor controller to pull the set from
texTexture to bind to the descriptor set (namely the sampler and image view)
Returns
Returns a new descriptor set ready to be bound to a command buffer (valid until vk2dDescConReset is called)

◆ vk2dDescConGetSet()

VkDescriptorSet vk2dDescConGetSet ( VK2DDescCon  descCon)

Creates, updates, and returns a blank descriptor set.

Parameters
descConDescriptor controller to pull the set from
Returns
Returns a new descriptor set

◆ vk2dDescConReset()

void vk2dDescConReset ( VK2DDescCon  descCon)

Resets all pools in a descriptor controller (basically deletes all active sets so new ones can be allocated)

Parameters
descConDescriptor controller to reset

◆ vk2dDescConUpdateAfterBind()

void vk2dDescConUpdateAfterBind ( VK2DDescCon  descCon)

Tells the desc con to allocate pools with update after bind.

Parameters
descConDesc con to enable this one
Warning
Make sure the DSL for this desc con had update after bind specified