Wasabi
Classes | Public Member Functions | List of all members
WVulkanMemoryManager Class Reference

Public Member Functions

WError Initialize (VkPhysicalDevice physicalDevice, VkDevice device, VkQueue queue, uint32_t graphicsQueueIndex)
 
VkCommandPool GetCommandPool () const
 
void GetMemoryType (uint32_t typeBits, VkFlags properties, uint *typeIndex) const
 
VkResult BeginCopyCommandBuffer ()
 
VkResult EndCopyCommandBuffer (bool waitQueue, VkFence signalFence=VK_NULL_HANDLE)
 
VkCommandBuffer GetCopyCommandBuffer () const
 
void ReleaseAllResources (uint32_t setBufferingCount=-1)
 
void ReleaseFrameResources (uint32_t bufferIndex)
 
void ReleaseRenderPass (VkRenderPass &renderPass, uint32_t bufferIndex)
 
void ReleaseShaderModule (VkShaderModule &shaderModule, uint32_t bufferIndex)
 
void ReleaseDescriptorSet (VkDescriptorSet &descriptorSet, VkDescriptorPool &descriptorPool, uint32_t bufferIndex)
 
void ReleaseDescriptorSetLayout (VkDescriptorSetLayout &descriptorSetLayout, uint32_t bufferIndex)
 
void ReleasePipeline (VkPipeline &pipeline, uint32_t bufferIndex)
 
void ReleasePipelineCache (VkPipelineCache &pipelineCache, uint32_t bufferIndex)
 
void ReleasePipelineLayout (VkPipelineLayout &pipelineLayout, uint32_t bufferIndex)
 
void ReleaseDescriptorPool (VkDescriptorPool &descriptorPool, uint32_t bufferIndex)
 
void ReleaseFramebuffer (VkFramebuffer &framebuffer, uint32_t bufferIndex)
 
void ReleaseBuffer (VkBuffer &buffer, uint32_t bufferIndex)
 
void ReleaseImage (VkImage &image, uint32_t bufferIndex)
 
void ReleaseImageView (VkImageView &imageView, uint32_t bufferIndex)
 
void ReleaseDeviceMemory (VkDeviceMemory &deviceMemory, uint32_t bufferIndex)
 
void ReleaseSampler (VkSampler &sampler, uint32_t bufferIndex)
 
void ReleaseCommandBuffer (VkCommandBuffer &commandBuffer, uint32_t bufferIndex)
 
void ReleaseSemaphore (VkSemaphore &semaphore, uint32_t bufferIndex)
 
void ReleaseFence (VkFence &fence, uint32_t bufferIndex)
 

Member Function Documentation

◆ BeginCopyCommandBuffer()

VkResult WVulkanMemoryManager::BeginCopyCommandBuffer ( )

Starts recording commands on the copy command buffer, which can be acquired using GetCopyCommandBuffer().

Returns
A Vulkan result, VK_SUCCESS on success

◆ EndCopyCommandBuffer()

VkResult WVulkanMemoryManager::EndCopyCommandBuffer ( bool  waitQueue,
VkFence  signalFence = VK_NULL_HANDLE 
)

Ends recording commands on the copy command buffer and submits it to the graphics queue.

Parameters
waitQueueWhether or not to wait for the queue to finish copying
signalFenceA fence to signal when GPU finishes with the submission
Returns
A Vulkan result, VK_SUCCESS on success

◆ GetCommandPool()

VkCommandPool WVulkanMemoryManager::GetCommandPool ( ) const

Retrieves a Vulkan command pool to be used to initialize command buffers.

Returns
A Vulkan command pool

◆ GetCopyCommandBuffer()

VkCommandBuffer WVulkanMemoryManager::GetCopyCommandBuffer ( ) const

Retrieves the copy command buffer that is used with BeginCopyCommandBuffer() and EndCopyCommandBuffer().

Returns
The copy command buffer

◆ GetMemoryType()

void WVulkanMemoryManager::GetMemoryType ( uint32_t  typeBits,
VkFlags  properties,
uint *  typeIndex 
) const

Retrieves the index of a Vulakn memory type that is compatible with the requested memory type and properties

Parameters
typeBitsA 32-bit value, in which each bit represents a usable memory type
propertiesThe requested memory properties to be found
typeIndexPointer to an index to be filled

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