Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
VulkanHelper Class Reference

Stores lots of different functions which shorten the amount of code which needs to be written for default vulkan operations. More...

#include <VulkanHelper.h>

Collaboration diagram for VulkanHelper:

Static Public Member Functions

static void initializeDebugFunctions (VkInstance instance)
static void initializeFunctions (VkInstance instance, VkDevice device)
static const VulkanFunctionsgetFunctions ()
template<typename T>
static void loadVkFunction (VkInstance instance, const std::string &name, T &functionPointer)
template<typename T>
static void loadVkDeviceFunction (VkDevice device, const std::string &name, T &functionPointer)
static void createBuffer (VkDevice device, VkPhysicalDevice physicalDevice, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer &buffer, VkDeviceMemory &bufferMemory)
static void uploadDataToExistingBuffer (VkDevice device, VkPhysicalDevice physicalDevice, VkCommandPool commandPool, VkQueue queue, VkDeviceSize size, const void *dataPtr, VkBuffer targetBuffer)
static bool isValid (void *object)
static std::string strIsValid (void *object)
static uint32_t findMemoryType (VkPhysicalDevice physicalDevice, uint32_t typeFilter, VkMemoryPropertyFlags properties)
static bool findSuitableMemoryType (VkPhysicalDevice physicalDevice, VkMemoryRequirements2 requirements, VkMemoryPropertyFlags properties, uint32_t &out_typeIndex)
static VkDeviceSize align (VkDeviceSize value, VkDeviceSize alignment)
static void copyBuffer (VkDevice device, VkCommandPool commandPool, VkQueue graphicsQueue, VkBuffer sourceBuffer, VkBuffer destinationBuffer, VkDeviceSize size)
static void copyBufferMultiple (VkDevice device, VkCommandPool commandPool, VkQueue graphicsQueue, const std::vector< BufferCopyObject > &bufferCopyObjects)
static void recordBufferCopyMultiple (Engine::Core::ApplicationContext *context, VkCommandBuffer commandBuffer, const std::vector< BufferCopyObject > &bufferCopyObjects)
static VkCommandBuffer beginSingleTimeCommands (VkDevice device, VkCommandPool commandPool)
static void endSingleTimeCommands (VkDevice device, VkQueue graphicsQueue, VkCommandPool commandPool, VkCommandBuffer commandBuffer)
static void cleanupBuffer (VkDevice device, VkBuffer buffer, VkDeviceMemory bufferMemory)
static void createImage (VkDevice device, VkPhysicalDevice physicalDevice, uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage &image, VkDeviceMemory &imageMemory)
static void transitionImageLayout (VkCommandBuffer commandBuffer, VkDevice device, VkQueue graphicsQueue, VkCommandPool commandPool, VkImage image, VkFormat format, VkImageLayout oldLayout, VkImageLayout newLayout, uint32_t layerCount=1)
static bool hasStencilComponent (VkFormat format)
static void copyBufferToImage (VkDevice device, VkCommandPool commandPool, VkQueue graphicsQueue, VkBuffer buffer, VkImage image, uint32_t width, uint32_t height)
static VkImageView createImageView (VkDevice device, VkImage image, VkFormat format, VkImageAspectFlags aspectFlags)
static VkDescriptorBufferInfo fullBufferInfo (VkBuffer buffer)
static VkResult allocateDescriptorSets (VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets, const std::string &name)
static VkResult createSemaphore (VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore, const std::string &name)
static VkResult allocateCommandBuffers (VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers, const std::string &name)
static VkResult createDescriptorSetLayout (VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout, const std::string &name)
static VkResult createPipelineLayout (VkDevice device, const VkPipelineLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkPipelineLayout *pPipelineLayout, const std::string &name)
static void createFence (VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence, const std::string &name)
static VkResult createDescriptorPool (VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool, const std::string &name)
static void beginLabel (VkCommandBuffer, const char *, const float *)
static void endLabel (VkCommandBuffer)
template<typename VulkanObjectType>
static void setObjectName (VkDevice device, VulkanObjectType objectHandle, const std::string &name)
template<typename VulkanObjectType>
static std::string getDebugName (VulkanObjectType objectHandle)

Static Private Member Functions

static std::string getName (const std::string &name, const std::string &suffix)

Static Private Attributes

static VulkanFunctions s_functions
static DynamicFunctionInitState s_functionInitializationState
static std::mutex s_mutex

Detailed Description

Stores lots of different functions which shorten the amount of code which needs to be written for default vulkan operations.

Definition at line 59 of file VulkanHelper.h.

Member Function Documentation

◆ align()

VkDeviceSize VulkanHelper::align ( VkDeviceSize value,
VkDeviceSize alignment )
static

◆ allocateCommandBuffers()

VkResult VulkanHelper::allocateCommandBuffers ( VkDevice device,
const VkCommandBufferAllocateInfo * pAllocateInfo,
VkCommandBuffer * pCommandBuffers,
const std::string & name )
static

◆ allocateDescriptorSets()

VkResult VulkanHelper::allocateDescriptorSets ( VkDevice device,
const VkDescriptorSetAllocateInfo * pAllocateInfo,
VkDescriptorSet * pDescriptorSets,
const std::string & name )
static

◆ beginLabel()

void VulkanHelper::beginLabel ( VkCommandBuffer ,
const char * ,
const float *  )
inlinestatic

Definition at line 286 of file VulkanHelper.h.

◆ beginSingleTimeCommands()

VkCommandBuffer VulkanHelper::beginSingleTimeCommands ( VkDevice device,
VkCommandPool commandPool )
static

◆ cleanupBuffer()

void VulkanHelper::cleanupBuffer ( VkDevice device,
VkBuffer buffer,
VkDeviceMemory bufferMemory )
static

◆ copyBuffer()

void VulkanHelper::copyBuffer ( VkDevice device,
VkCommandPool commandPool,
VkQueue graphicsQueue,
VkBuffer sourceBuffer,
VkBuffer destinationBuffer,
VkDeviceSize size )
static

◆ copyBufferMultiple()

void VulkanHelper::copyBufferMultiple ( VkDevice device,
VkCommandPool commandPool,
VkQueue graphicsQueue,
const std::vector< BufferCopyObject > & bufferCopyObjects )
static

◆ copyBufferToImage()

void VulkanHelper::copyBufferToImage ( VkDevice device,
VkCommandPool commandPool,
VkQueue graphicsQueue,
VkBuffer buffer,
VkImage image,
uint32_t width,
uint32_t height )
static

◆ createBuffer()

void VulkanHelper::createBuffer ( VkDevice device,
VkPhysicalDevice physicalDevice,
VkDeviceSize size,
VkBufferUsageFlags usage,
VkMemoryPropertyFlags properties,
VkBuffer & buffer,
VkDeviceMemory & bufferMemory )
static

◆ createDescriptorPool()

VkResult VulkanHelper::createDescriptorPool ( VkDevice device,
const VkDescriptorPoolCreateInfo * pCreateInfo,
const VkAllocationCallbacks * pAllocator,
VkDescriptorPool * pDescriptorPool,
const std::string & name )
static

◆ createDescriptorSetLayout()

VkResult VulkanHelper::createDescriptorSetLayout ( VkDevice device,
const VkDescriptorSetLayoutCreateInfo * pCreateInfo,
const VkAllocationCallbacks * pAllocator,
VkDescriptorSetLayout * pSetLayout,
const std::string & name )
static

◆ createFence()

void VulkanHelper::createFence ( VkDevice device,
const VkFenceCreateInfo * pCreateInfo,
const VkAllocationCallbacks * pAllocator,
VkFence * pFence,
const std::string & name )
static

◆ createImage()

void VulkanHelper::createImage ( VkDevice device,
VkPhysicalDevice physicalDevice,
uint32_t width,
uint32_t height,
VkFormat format,
VkImageTiling tiling,
VkImageUsageFlags usage,
VkMemoryPropertyFlags properties,
VkImage & image,
VkDeviceMemory & imageMemory )
static

◆ createImageView()

VkImageView VulkanHelper::createImageView ( VkDevice device,
VkImage image,
VkFormat format,
VkImageAspectFlags aspectFlags )
static

◆ createPipelineLayout()

VkResult VulkanHelper::createPipelineLayout ( VkDevice device,
const VkPipelineLayoutCreateInfo * pCreateInfo,
const VkAllocationCallbacks * pAllocator,
VkPipelineLayout * pPipelineLayout,
const std::string & name )
static

◆ createSemaphore()

VkResult VulkanHelper::createSemaphore ( VkDevice device,
const VkSemaphoreCreateInfo * pCreateInfo,
const VkAllocationCallbacks * pAllocator,
VkSemaphore * pSemaphore,
const std::string & name )
static

◆ endLabel()

void VulkanHelper::endLabel ( VkCommandBuffer )
inlinestatic

Definition at line 288 of file VulkanHelper.h.

◆ endSingleTimeCommands()

void VulkanHelper::endSingleTimeCommands ( VkDevice device,
VkQueue graphicsQueue,
VkCommandPool commandPool,
VkCommandBuffer commandBuffer )
static

◆ findMemoryType()

uint32_t VulkanHelper::findMemoryType ( VkPhysicalDevice physicalDevice,
uint32_t typeFilter,
VkMemoryPropertyFlags properties )
static

◆ findSuitableMemoryType()

bool VulkanHelper::findSuitableMemoryType ( VkPhysicalDevice physicalDevice,
VkMemoryRequirements2 requirements,
VkMemoryPropertyFlags properties,
uint32_t & out_typeIndex )
static

◆ fullBufferInfo()

VkDescriptorBufferInfo VulkanHelper::fullBufferInfo ( VkBuffer buffer)
static

◆ getDebugName()

template<typename VulkanObjectType>
std::string VulkanHelper::getDebugName ( VulkanObjectType objectHandle)
inlinestatic

Definition at line 345 of file VulkanHelper.h.

◆ getFunctions()

const VulkanFunctions & VulkanHelper::getFunctions ( )
static

◆ getName()

std::string VulkanHelper::getName ( const std::string & name,
const std::string & suffix )
staticprivate

◆ hasStencilComponent()

bool VulkanHelper::hasStencilComponent ( VkFormat format)
static

◆ initializeDebugFunctions()

void VulkanHelper::initializeDebugFunctions ( VkInstance instance)
static

◆ initializeFunctions()

void VulkanHelper::initializeFunctions ( VkInstance instance,
VkDevice device )
static

◆ isValid()

bool VulkanHelper::isValid ( void * object)
static

◆ loadVkDeviceFunction()

template<typename T>
void VulkanHelper::loadVkDeviceFunction ( VkDevice device,
const std::string & name,
T & functionPointer )
inlinestatic

Definition at line 81 of file VulkanHelper.h.

◆ loadVkFunction()

template<typename T>
void VulkanHelper::loadVkFunction ( VkInstance instance,
const std::string & name,
T & functionPointer )
inlinestatic

Definition at line 67 of file VulkanHelper.h.

◆ recordBufferCopyMultiple()

void VulkanHelper::recordBufferCopyMultiple ( Engine::Core::ApplicationContext * context,
VkCommandBuffer commandBuffer,
const std::vector< BufferCopyObject > & bufferCopyObjects )
static

◆ setObjectName()

template<typename VulkanObjectType>
void VulkanHelper::setObjectName ( VkDevice device,
VulkanObjectType objectHandle,
const std::string & name )
inlinestatic

Definition at line 340 of file VulkanHelper.h.

◆ strIsValid()

std::string VulkanHelper::strIsValid ( void * object)
static

◆ transitionImageLayout()

void VulkanHelper::transitionImageLayout ( VkCommandBuffer commandBuffer,
VkDevice device,
VkQueue graphicsQueue,
VkCommandPool commandPool,
VkImage image,
VkFormat format,
VkImageLayout oldLayout,
VkImageLayout newLayout,
uint32_t layerCount = 1 )
static

◆ uploadDataToExistingBuffer()

void VulkanHelper::uploadDataToExistingBuffer ( VkDevice device,
VkPhysicalDevice physicalDevice,
VkCommandPool commandPool,
VkQueue queue,
VkDeviceSize size,
const void * dataPtr,
VkBuffer targetBuffer )
static

Member Data Documentation

◆ s_functionInitializationState

DynamicFunctionInitState VulkanHelper::s_functionInitializationState
staticprivate

Definition at line 353 of file VulkanHelper.h.

◆ s_functions

VulkanFunctions VulkanHelper::s_functions
staticprivate

Definition at line 352 of file VulkanHelper.h.

◆ s_mutex

std::mutex VulkanHelper::s_mutex
staticprivate

Definition at line 354 of file VulkanHelper.h.


The documentation for this class was generated from the following file:
  • /home/magerbeton/Documents/gl3-vulkan/Engine/include/Engine/Core/VulkanHelper.h