|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
Stores lots of different functions which shorten the amount of code which needs to be written for default vulkan operations. More...
#include <VulkanHelper.h>
Static Public Member Functions | |
| static void | initializeDebugFunctions (VkInstance instance) |
| static void | initializeFunctions (VkInstance instance, VkDevice device) |
| static const VulkanFunctions & | getFunctions () |
| 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 void | createBufferWithStaging (VkDevice device, VkPhysicalDevice physicalDevice, VkCommandPool commandPool, VkQueue queue, VkDeviceSize size, VkBufferUsageFlags usage, const void *dataPtr, VkBuffer &buffer, VkDeviceMemory &bufferMemory) |
| static void | copyDataToBufferViaStaging (VkDevice device, VkPhysicalDevice physicalDevice, VkCommandPool commandPool, VkQueue queue, VkDeviceSize size, const void *dataPtr, VkBuffer buffer, VkDeviceMemory bufferMemory) |
| 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 (EngineCore::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 = NOT_INITIALIZED |
| static std::mutex | s_mutex |
Stores lots of different functions which shorten the amount of code which needs to be written for default vulkan operations.
Definition at line 55 of file VulkanHelper.h.
|
static |
Definition at line 310 of file VulkanHelper.cpp.
|
static |
Definition at line 749 of file VulkanHelper.cpp.
References getName(), and setObjectName().
|
static |
Definition at line 723 of file VulkanHelper.cpp.
References getName(), and setObjectName().
Referenced by EngineCore::ComputePass::createDescriptorSet().
|
inlinestatic |
Definition at line 313 of file VulkanHelper.h.
|
static |
Definition at line 454 of file VulkanHelper.cpp.
References setObjectName().
Referenced by copyBuffer(), copyBufferMultiple(), copyBufferToImage(), EngineCore::Headset::Headset(), and EngineCore::Renderer::initializeXrSwapchainFormats().
|
static |
Definition at line 495 of file VulkanHelper.cpp.
|
static |
Definition at line 319 of file VulkanHelper.cpp.
References beginSingleTimeCommands(), endSingleTimeCommands(), and TRACY_ZONE_SCOPED_NAMED.
Referenced by copyDataToBufferViaStaging(), createBufferWithStaging(), and uploadDataToExistingBuffer().
|
static |
Definition at line 340 of file VulkanHelper.cpp.
References beginSingleTimeCommands(), endSingleTimeCommands(), and TRACY_ZONE_SCOPED_NAMED.
|
static |
Definition at line 645 of file VulkanHelper.cpp.
References beginSingleTimeCommands(), and endSingleTimeCommands().
|
static |
Definition at line 228 of file VulkanHelper.cpp.
References copyBuffer(), and createBuffer().
|
static |
Definition at line 76 of file VulkanHelper.cpp.
References findMemoryType(), getDebugName(), and TRACY_ZONE_SCOPED_NAMED.
Referenced by copyDataToBufferViaStaging(), EngineCore::VulkanBuffer::create(), createBufferWithStaging(), and uploadDataToExistingBuffer().
|
static |
Definition at line 183 of file VulkanHelper.cpp.
References copyBuffer(), and createBuffer().
|
static |
Definition at line 800 of file VulkanHelper.cpp.
References getName(), and setObjectName().
Referenced by EngineCore::Renderer::createHiZMipDescriptorSets(), and EngineCore::Renderer::createHiZSPDDescriptorSets().
|
static |
Definition at line 761 of file VulkanHelper.cpp.
References getName(), and setObjectName().
Referenced by EngineCore::Renderer::allocateDescriptors(), and EngineCore::ComputePass::create().
|
static |
Definition at line 788 of file VulkanHelper.cpp.
References getName(), and setObjectName().
|
static |
Definition at line 503 of file VulkanHelper.cpp.
References findMemoryType().
|
static |
Definition at line 675 of file VulkanHelper.cpp.
|
static |
Definition at line 774 of file VulkanHelper.cpp.
References getName(), and setObjectName().
Referenced by EngineCore::Renderer::allocateDescriptors(), and EngineCore::ComputePass::create().
|
static |
Definition at line 735 of file VulkanHelper.cpp.
References getName(), and setObjectName().
|
inlinestatic |
Definition at line 315 of file VulkanHelper.h.
|
static |
Definition at line 475 of file VulkanHelper.cpp.
Referenced by copyBuffer(), copyBufferMultiple(), copyBufferToImage(), EngineCore::Headset::Headset(), and EngineCore::Renderer::initializeXrSwapchainFormats().
|
static |
Definition at line 263 of file VulkanHelper.cpp.
Referenced by createBuffer(), and createImage().
|
static |
Definition at line 284 of file VulkanHelper.cpp.
Referenced by EngineCore::RenderProcess::createHiZPyramid(), and EngineCore::Headset::Headset().
|
static |
Definition at line 710 of file VulkanHelper.cpp.
References getDebugName(), and strIsValid().
Referenced by EngineCore::RenderProcess::updateComputeBinningAllocatorDescriptorSets(), EngineCore::RenderProcess::updateComputeMeshletCullingDescriptorSets(), EngineCore::RenderProcess::updateComputeMeshletCullingDispatcherDescriptorSets(), EngineCore::RenderProcess::updateComputeMeshletUnpackingDescriptorSets(), EngineCore::RenderProcess::updateComputeMeshletUnpackingDispatcherDescriptorSets(), EngineCore::RenderProcess::updateComputeObjectCullingDescriptorSets(), EngineCore::RenderProcess::updateComputePrepareDrawDescriptorSets(), EngineCore::RenderProcess::updateComputeVSBinningAllocatorDescriptorSets(), EngineCore::RenderProcess::updateComputeVSInstanceUnpackingDescriptorSets(), EngineCore::RenderProcess::updateComputeVSPrepareDrawDescriptorSets(), EngineCore::Renderer::updateHiZSPDDescriptorSets(), and EngineCore::RenderProcess::updateRendererDescriptorSets().
|
inlinestatic |
Definition at line 372 of file VulkanHelper.h.
Referenced by createBuffer(), EngineCore::ComputePass::createDescriptorSet(), fullBufferInfo(), and EngineCore::ComputePass::updateDescriptorSet().
|
static |
Definition at line 65 of file VulkanHelper.cpp.
References s_functionInitializationState, and s_functions.
Referenced by EngineCore::Engine::cleanup(), EngineCore::Engine::createVulkanDebugMessenger(), EngineCore::Engine::mainLoop(), EngineCore::Renderer::recordPass2RenderPass(), and EngineCore::Renderer::recordRenderPass().
|
staticprivate |
Definition at line 813 of file VulkanHelper.cpp.
Referenced by allocateCommandBuffers(), allocateDescriptorSets(), createDescriptorPool(), createDescriptorSetLayout(), createFence(), createPipelineLayout(), and createSemaphore().
|
static |
Definition at line 640 of file VulkanHelper.cpp.
Referenced by transitionImageLayout().
|
static |
Definition at line 17 of file VulkanHelper.cpp.
References DEBUG_FUNCTIONS_INITIALIZED, loadVkFunction(), s_functionInitializationState, and s_functions.
Referenced by EngineCore::ApplicationContext::createResources(), and initializeFunctions().
|
static |
Definition at line 32 of file VulkanHelper.cpp.
References FINISHED, initializeDebugFunctions(), loadVkDeviceFunction(), loadVkFunction(), s_functionInitializationState, s_functions, and s_mutex.
Referenced by EngineCore::Engine::initVulkan().
|
static |
Definition at line 173 of file VulkanHelper.cpp.
Referenced by strIsValid().
|
inlinestatic |
Definition at line 77 of file VulkanHelper.h.
Referenced by initializeFunctions().
|
inlinestatic |
Definition at line 63 of file VulkanHelper.h.
Referenced by initializeDebugFunctions(), and initializeFunctions().
|
static |
Definition at line 364 of file VulkanHelper.cpp.
References EngineCore::ApplicationContext::getVkGraphicsQueueFamilyIndex(), EngineCore::ApplicationContext::getVkTransferQueueFamilyIndex(), and TRACY_ZONE_SCOPED_FUNCTION.
|
inlinestatic |
Definition at line 367 of file VulkanHelper.h.
Referenced by allocateCommandBuffers(), allocateDescriptorSets(), beginSingleTimeCommands(), EngineCore::ComputePipeline::ComputePipeline(), ComputeShader::ComputeShader(), createDescriptorPool(), createDescriptorSetLayout(), EngineCore::ApplicationContext::createDevice(), createFence(), EngineCore::RenderProcess::createHiZPyramid(), EngineCore::Headset::createHiZSampler(), createPipelineLayout(), createSemaphore(), EngineCore::Renderer::createVertexShaderPathResources(), EngineCore::Headset::Headset(), EngineCore::Texture::setDebugName(), and EngineCore::VulkanBuffer::setDebugName().
|
static |
Definition at line 178 of file VulkanHelper.cpp.
References CHECK_STR, CROSS_STR, and isValid().
Referenced by EngineCore::Renderer::allocateDescriptors(), and fullBufferInfo().
|
static |
Definition at line 554 of file VulkanHelper.cpp.
References hasStencilComponent().
Referenced by EngineCore::Headset::Headset().
|
static |
Definition at line 136 of file VulkanHelper.cpp.
References copyBuffer(), and createBuffer().
Referenced by EngineCore::RenderProcess::createIndirectDrawBuffer().
|
staticprivate |
Definition at line 380 of file VulkanHelper.h.
Referenced by getFunctions(), initializeDebugFunctions(), and initializeFunctions().
|
staticprivate |
Definition at line 379 of file VulkanHelper.h.
Referenced by getFunctions(), initializeDebugFunctions(), and initializeFunctions().
|
staticprivate |
Definition at line 381 of file VulkanHelper.h.
Referenced by initializeFunctions().