Skip to content

KDGpu::VulkanResourceManager

#include <vulkan_resource_manager.h>

Public Functions

Name
VulkanResourceManager()
~VulkanResourceManager()
Handle< Instance_t > createInstance(const InstanceOptions & options)
Handle< Instance_t > createInstanceFromExistingVkInstance(VkInstance vkInstance)
void deleteInstance(const Handle< Instance_t > & handle)
VulkanInstance * getInstance(const Handle< Instance_t > & handle) const
std::vector< Extension > getInstanceExtensions() const
Handle< Adapter_t > insertAdapter(const VulkanAdapter & vulkanAdapter)
void removeAdapter(const Handle< Adapter_t > & handle)
VulkanAdapter * getAdapter(const Handle< Adapter_t > & handle) const
Handle< Device_t > createDevice(const Handle< Adapter_t > & adapterHandle, const DeviceOptions & options, std::vector< QueueRequest > & queueRequests)
Handle< Device_t > createDeviceFromExistingVkDevice(const Handle< Adapter_t > & adapterHandle, VkDevice vkDevice)
void deleteDevice(const Handle< Device_t > & handle)
VulkanDevice * getDevice(const Handle< Device_t > & handle) const
Handle< Queue_t > insertQueue(const VulkanQueue & vulkanQueue)
void removeQueue(const Handle< Queue_t > & handle)
VulkanQueue * getQueue(const Handle< Queue_t > & handle) const
Handle< Swapchain_t > createSwapchain(const Handle< Device_t > & deviceHandle, const SwapchainOptions & options)
void deleteSwapchain(const Handle< Swapchain_t > & handle)
VulkanSwapchain * getSwapchain(const Handle< Swapchain_t > & handle) const
Handle< Surface_t > insertSurface(const VulkanSurface & surface)
void deleteSurface(const Handle< Surface_t > & handle)
VulkanSurface * getSurface(const Handle< Surface_t > & handle) const
Handle< Texture_t > insertTexture(const VulkanTexture & texture)
void removeTexture(const Handle< Texture_t > & handle)
Handle< Texture_t > createTexture(const Handle< Device_t > & deviceHandle, const TextureOptions & options)
void deleteTexture(const Handle< Texture_t > & handle)
VulkanTexture * getTexture(const Handle< Texture_t > & handle) const
Handle< TextureView_t > createTextureView(const Handle< Device_t > & deviceHandle, const Handle< Texture_t > & textureHandle, const TextureViewOptions & options)
void deleteTextureView(const Handle< TextureView_t > & handle)
VulkanTextureView * getTextureView(const Handle< TextureView_t > & handle) const
Handle< Buffer_t > createBuffer(const Handle< Device_t > & deviceHandle, const BufferOptions & options, const void * initialData)
void deleteBuffer(const Handle< Buffer_t > & handle)
VulkanBuffer * getBuffer(const Handle< Buffer_t > & handle) const
Handle< ShaderModule_t > createShaderModule(const Handle< Device_t > & deviceHandle, const std::vector< uint32_t > & code)
void deleteShaderModule(const Handle< ShaderModule_t > & handle)
VulkanShaderModule * getShaderModule(const Handle< ShaderModule_t > & handle) const
Handle< RenderPass_t > createRenderPass(const Handle< Device_t > & deviceHandle, const RenderPassOptions & options)
void deleteRenderPass(const Handle< RenderPass_t > & handle)
VulkanRenderPass * getRenderPass(const Handle< RenderPass_t > & handle)
Handle< PipelineLayout_t > createPipelineLayout(const Handle< Device_t > & deviceHandle, const PipelineLayoutOptions & options)
void deletePipelineLayout(const Handle< PipelineLayout_t > & handle)
VulkanPipelineLayout * getPipelineLayout(const Handle< PipelineLayout_t > & handle) const
Handle< GraphicsPipeline_t > createGraphicsPipeline(const Handle< Device_t > & deviceHandle, const GraphicsPipelineOptions & options)
void deleteGraphicsPipeline(const Handle< GraphicsPipeline_t > & handle)
VulkanGraphicsPipeline * getGraphicsPipeline(const Handle< GraphicsPipeline_t > & handle) const
Handle< ComputePipeline_t > createComputePipeline(const Handle< Device_t > & deviceHandle, const ComputePipelineOptions & options)
void deleteComputePipeline(const Handle< ComputePipeline_t > & handle)
VulkanComputePipeline * getComputePipeline(const Handle< ComputePipeline_t > & handle) const
Handle< RayTracingPipeline_t > createRayTracingPipeline(const Handle< Device_t > & deviceHandle, const RayTracingPipelineOptions & options)
void deleteRayTracingPipeline(const Handle< RayTracingPipeline_t > & handle)
VulkanRayTracingPipeline * getRayTracingPipeline(const Handle< RayTracingPipeline_t > & handle) const
Handle< GpuSemaphore_t > createGpuSemaphore(const Handle< Device_t > & deviceHandle, const GpuSemaphoreOptions & options)
void deleteGpuSemaphore(const Handle< GpuSemaphore_t > & handle)
VulkanGpuSemaphore * getGpuSemaphore(const Handle< GpuSemaphore_t > & handle) const
Handle< CommandRecorder_t > createCommandRecorder(const Handle< Device_t > & deviceHandle, const CommandRecorderOptions & options)
void deleteCommandRecorder(const Handle< CommandRecorder_t > & handle)
VulkanCommandRecorder * getCommandRecorder(const Handle< CommandRecorder_t > & handle) const
Handle< RenderPassCommandRecorder_t > createRenderPassCommandRecorder(const Handle< Device_t > & deviceHandle, const Handle< CommandRecorder_t > & commandRecorderHandle, const RenderPassCommandRecorderOptions & options)
void deleteRenderPassCommandRecorder(const Handle< RenderPassCommandRecorder_t > & handle)
VulkanRenderPassCommandRecorder * getRenderPassCommandRecorder(const Handle< RenderPassCommandRecorder_t > & handle) const
Handle< ComputePassCommandRecorder_t > createComputePassCommandRecorder(const Handle< Device_t > & deviceHandle, const Handle< CommandRecorder_t > & commandRecorderHandle, const ComputePassCommandRecorderOptions & options)
void deleteComputePassCommandRecorder(const Handle< ComputePassCommandRecorder_t > & handle)
VulkanComputePassCommandRecorder * getComputePassCommandRecorder(const Handle< ComputePassCommandRecorder_t > & handle) const
void deleteRayTracingPassCommandRecorder(const Handle< RayTracingPassCommandRecorder_t > & handle)
VulkanRayTracingPassCommandRecorder * getRayTracingPassCommandRecorder(const Handle< RayTracingPassCommandRecorder_t > & handle) const
Handle< RayTracingPassCommandRecorder_t > createRayTracingPassCommandRecorder(const Handle< Device_t > & deviceHandle, const Handle< CommandRecorder_t > & commandRecorderHandle, const RayTracingPassCommandRecorderOptions & options)
Handle< TimestampQueryRecorder_t > createTimestampQueryRecorder(const Handle< Device_t > & deviceHandle, const Handle< CommandRecorder_t > & commandRecorderHandle, const TimestampQueryRecorderOptions & options)
void deleteTimestampQueryRecorder(const Handle< TimestampQueryRecorder_t > & handle)
VulkanTimestampQueryRecorder * getTimestampQueryRecorder(const Handle< TimestampQueryRecorder_t > & handle) const
Handle< CommandBuffer_t > createCommandBuffer(const Handle< Device_t > & deviceHandle, const QueueDescription & queueDescription, CommandBufferLevel commandLevel)
void deleteCommandBuffer(const Handle< CommandBuffer_t > & handle)
VulkanCommandBuffer * getCommandBuffer(const Handle< CommandBuffer_t > & handle) const
Handle< BindGroup_t > createBindGroup(const Handle< Device_t > & deviceHandle, const BindGroupOptions & options)
void deleteBindGroup(const Handle< BindGroup_t > & handle)
VulkanBindGroup * getBindGroup(const Handle< BindGroup_t > & handle) const
Handle< BindGroupLayout_t > createBindGroupLayout(const Handle< Device_t > & deviceHandle, const BindGroupLayoutOptions & options)
void deleteBindGroupLayout(const Handle< BindGroupLayout_t > & handle)
VulkanBindGroupLayout * getBindGroupLayout(const Handle< BindGroupLayout_t > & handle) const
Handle< Sampler_t > createSampler(const Handle< Device_t > & deviceHandle, const SamplerOptions & options)
void deleteSampler(const Handle< Sampler_t > & handle)
VulkanSampler * getSampler(const Handle< Sampler_t > & handle) const
Handle< Fence_t > createFence(const Handle< Device_t > & deviceHandle, const FenceOptions & options)
void deleteFence(const Handle< Fence_t > & handle)
VulkanFence * getFence(const Handle< Fence_t > & handle) const
Handle< AccelerationStructure_t > createAccelerationStructure(const Handle< Device_t > & deviceHandle, const AccelerationStructureOptions & options)
void deleteAccelerationStructure(const Handle< AccelerationStructure_t > & handle)
VulkanAccelerationStructure * getAccelerationStructure(const Handle< AccelerationStructure_t > & handle) const
std::string getMemoryStats(const Handle< Device_t > & device) const
KDGpu::Format formatFromTextureView(const Handle< TextureView_t > & viewHandle) const

Public Functions Documentation

function VulkanResourceManager

1
VulkanResourceManager()

function ~VulkanResourceManager

1
~VulkanResourceManager()

function createInstance

1
2
3
Handle< Instance_t > createInstance(
    const InstanceOptions & options
)

function createInstanceFromExistingVkInstance

1
2
3
Handle< Instance_t > createInstanceFromExistingVkInstance(
    VkInstance vkInstance
)

function deleteInstance

1
2
3
void deleteInstance(
    const Handle< Instance_t > & handle
)

function getInstance

1
2
3
VulkanInstance * getInstance(
    const Handle< Instance_t > & handle
) const

function getInstanceExtensions

1
std::vector< Extension > getInstanceExtensions() const

function insertAdapter

1
2
3
Handle< Adapter_t > insertAdapter(
    const VulkanAdapter & vulkanAdapter
)

function removeAdapter

1
2
3
void removeAdapter(
    const Handle< Adapter_t > & handle
)

function getAdapter

1
2
3
VulkanAdapter * getAdapter(
    const Handle< Adapter_t > & handle
) const

function createDevice

1
2
3
4
5
Handle< Device_t > createDevice(
    const Handle< Adapter_t > & adapterHandle,
    const DeviceOptions & options,
    std::vector< QueueRequest > & queueRequests
)

function createDeviceFromExistingVkDevice

1
2
3
4
Handle< Device_t > createDeviceFromExistingVkDevice(
    const Handle< Adapter_t > & adapterHandle,
    VkDevice vkDevice
)

function deleteDevice

1
2
3
void deleteDevice(
    const Handle< Device_t > & handle
)

function getDevice

1
2
3
VulkanDevice * getDevice(
    const Handle< Device_t > & handle
) const

function insertQueue

1
2
3
Handle< Queue_t > insertQueue(
    const VulkanQueue & vulkanQueue
)

function removeQueue

1
2
3
void removeQueue(
    const Handle< Queue_t > & handle
)

function getQueue

1
2
3
VulkanQueue * getQueue(
    const Handle< Queue_t > & handle
) const

function createSwapchain

1
2
3
4
Handle< Swapchain_t > createSwapchain(
    const Handle< Device_t > & deviceHandle,
    const SwapchainOptions & options
)

function deleteSwapchain

1
2
3
void deleteSwapchain(
    const Handle< Swapchain_t > & handle
)

function getSwapchain

1
2
3
VulkanSwapchain * getSwapchain(
    const Handle< Swapchain_t > & handle
) const

function insertSurface

1
2
3
Handle< Surface_t > insertSurface(
    const VulkanSurface & surface
)

function deleteSurface

1
2
3
void deleteSurface(
    const Handle< Surface_t > & handle
)

function getSurface

1
2
3
VulkanSurface * getSurface(
    const Handle< Surface_t > & handle
) const

function insertTexture

1
2
3
Handle< Texture_t > insertTexture(
    const VulkanTexture & texture
)

function removeTexture

1
2
3
void removeTexture(
    const Handle< Texture_t > & handle
)

function createTexture

1
2
3
4
Handle< Texture_t > createTexture(
    const Handle< Device_t > & deviceHandle,
    const TextureOptions & options
)

function deleteTexture

1
2
3
void deleteTexture(
    const Handle< Texture_t > & handle
)

function getTexture

1
2
3
VulkanTexture * getTexture(
    const Handle< Texture_t > & handle
) const

function createTextureView

1
2
3
4
5
Handle< TextureView_t > createTextureView(
    const Handle< Device_t > & deviceHandle,
    const Handle< Texture_t > & textureHandle,
    const TextureViewOptions & options
)

function deleteTextureView

1
2
3
void deleteTextureView(
    const Handle< TextureView_t > & handle
)

function getTextureView

1
2
3
VulkanTextureView * getTextureView(
    const Handle< TextureView_t > & handle
) const

function createBuffer

1
2
3
4
5
Handle< Buffer_t > createBuffer(
    const Handle< Device_t > & deviceHandle,
    const BufferOptions & options,
    const void * initialData
)

function deleteBuffer

1
2
3
void deleteBuffer(
    const Handle< Buffer_t > & handle
)

function getBuffer

1
2
3
VulkanBuffer * getBuffer(
    const Handle< Buffer_t > & handle
) const

function createShaderModule

1
2
3
4
Handle< ShaderModule_t > createShaderModule(
    const Handle< Device_t > & deviceHandle,
    const std::vector< uint32_t > & code
)

function deleteShaderModule

1
2
3
void deleteShaderModule(
    const Handle< ShaderModule_t > & handle
)

function getShaderModule

1
2
3
VulkanShaderModule * getShaderModule(
    const Handle< ShaderModule_t > & handle
) const

function createRenderPass

1
2
3
4
Handle< RenderPass_t > createRenderPass(
    const Handle< Device_t > & deviceHandle,
    const RenderPassOptions & options
)

ensures input attachment layout are changed to read-only, as per vulkan documentation: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkSubpassDescription2.html

function deleteRenderPass

1
2
3
void deleteRenderPass(
    const Handle< RenderPass_t > & handle
)

function getRenderPass

1
2
3
VulkanRenderPass * getRenderPass(
    const Handle< RenderPass_t > & handle
)

function createPipelineLayout

1
2
3
4
Handle< PipelineLayout_t > createPipelineLayout(
    const Handle< Device_t > & deviceHandle,
    const PipelineLayoutOptions & options
)

function deletePipelineLayout

1
2
3
void deletePipelineLayout(
    const Handle< PipelineLayout_t > & handle
)

function getPipelineLayout

1
2
3
VulkanPipelineLayout * getPipelineLayout(
    const Handle< PipelineLayout_t > & handle
) const

function createGraphicsPipeline

1
2
3
4
Handle< GraphicsPipeline_t > createGraphicsPipeline(
    const Handle< Device_t > & deviceHandle,
    const GraphicsPipelineOptions & options
)

function deleteGraphicsPipeline

1
2
3
void deleteGraphicsPipeline(
    const Handle< GraphicsPipeline_t > & handle
)

function getGraphicsPipeline

1
2
3
VulkanGraphicsPipeline * getGraphicsPipeline(
    const Handle< GraphicsPipeline_t > & handle
) const

function createComputePipeline

1
2
3
4
Handle< ComputePipeline_t > createComputePipeline(
    const Handle< Device_t > & deviceHandle,
    const ComputePipelineOptions & options
)

function deleteComputePipeline

1
2
3
void deleteComputePipeline(
    const Handle< ComputePipeline_t > & handle
)

function getComputePipeline

1
2
3
VulkanComputePipeline * getComputePipeline(
    const Handle< ComputePipeline_t > & handle
) const

function createRayTracingPipeline

1
2
3
4
Handle< RayTracingPipeline_t > createRayTracingPipeline(
    const Handle< Device_t > & deviceHandle,
    const RayTracingPipelineOptions & options
)

function deleteRayTracingPipeline

1
2
3
void deleteRayTracingPipeline(
    const Handle< RayTracingPipeline_t > & handle
)

function getRayTracingPipeline

1
2
3
VulkanRayTracingPipeline * getRayTracingPipeline(
    const Handle< RayTracingPipeline_t > & handle
) const

function createGpuSemaphore

1
2
3
4
Handle< GpuSemaphore_t > createGpuSemaphore(
    const Handle< Device_t > & deviceHandle,
    const GpuSemaphoreOptions & options
)

function deleteGpuSemaphore

1
2
3
void deleteGpuSemaphore(
    const Handle< GpuSemaphore_t > & handle
)

function getGpuSemaphore

1
2
3
VulkanGpuSemaphore * getGpuSemaphore(
    const Handle< GpuSemaphore_t > & handle
) const

function createCommandRecorder

1
2
3
4
Handle< CommandRecorder_t > createCommandRecorder(
    const Handle< Device_t > & deviceHandle,
    const CommandRecorderOptions & options
)

function deleteCommandRecorder

1
2
3
void deleteCommandRecorder(
    const Handle< CommandRecorder_t > & handle
)

function getCommandRecorder

1
2
3
VulkanCommandRecorder * getCommandRecorder(
    const Handle< CommandRecorder_t > & handle
) const

function createRenderPassCommandRecorder

1
2
3
4
5
Handle< RenderPassCommandRecorder_t > createRenderPassCommandRecorder(
    const Handle< Device_t > & deviceHandle,
    const Handle< CommandRecorder_t > & commandRecorderHandle,
    const RenderPassCommandRecorderOptions & options
)

function deleteRenderPassCommandRecorder

1
2
3
void deleteRenderPassCommandRecorder(
    const Handle< RenderPassCommandRecorder_t > & handle
)

function getRenderPassCommandRecorder

1
2
3
VulkanRenderPassCommandRecorder * getRenderPassCommandRecorder(
    const Handle< RenderPassCommandRecorder_t > & handle
) const

function createComputePassCommandRecorder

1
2
3
4
5
Handle< ComputePassCommandRecorder_t > createComputePassCommandRecorder(
    const Handle< Device_t > & deviceHandle,
    const Handle< CommandRecorder_t > & commandRecorderHandle,
    const ComputePassCommandRecorderOptions & options
)

function deleteComputePassCommandRecorder

1
2
3
void deleteComputePassCommandRecorder(
    const Handle< ComputePassCommandRecorder_t > & handle
)

function getComputePassCommandRecorder

1
2
3
VulkanComputePassCommandRecorder * getComputePassCommandRecorder(
    const Handle< ComputePassCommandRecorder_t > & handle
) const

function deleteRayTracingPassCommandRecorder

1
2
3
void deleteRayTracingPassCommandRecorder(
    const Handle< RayTracingPassCommandRecorder_t > & handle
)

function getRayTracingPassCommandRecorder

1
2
3
VulkanRayTracingPassCommandRecorder * getRayTracingPassCommandRecorder(
    const Handle< RayTracingPassCommandRecorder_t > & handle
) const

function createRayTracingPassCommandRecorder

1
2
3
4
5
Handle< RayTracingPassCommandRecorder_t > createRayTracingPassCommandRecorder(
    const Handle< Device_t > & deviceHandle,
    const Handle< CommandRecorder_t > & commandRecorderHandle,
    const RayTracingPassCommandRecorderOptions & options
)

function createTimestampQueryRecorder

1
2
3
4
5
Handle< TimestampQueryRecorder_t > createTimestampQueryRecorder(
    const Handle< Device_t > & deviceHandle,
    const Handle< CommandRecorder_t > & commandRecorderHandle,
    const TimestampQueryRecorderOptions & options
)

function deleteTimestampQueryRecorder

1
2
3
void deleteTimestampQueryRecorder(
    const Handle< TimestampQueryRecorder_t > & handle
)

function getTimestampQueryRecorder

1
2
3
VulkanTimestampQueryRecorder * getTimestampQueryRecorder(
    const Handle< TimestampQueryRecorder_t > & handle
) const

function createCommandBuffer

1
2
3
4
5
Handle< CommandBuffer_t > createCommandBuffer(
    const Handle< Device_t > & deviceHandle,
    const QueueDescription & queueDescription,
    CommandBufferLevel commandLevel
)

function deleteCommandBuffer

1
2
3
void deleteCommandBuffer(
    const Handle< CommandBuffer_t > & handle
)

function getCommandBuffer

1
2
3
VulkanCommandBuffer * getCommandBuffer(
    const Handle< CommandBuffer_t > & handle
) const

function createBindGroup

1
2
3
4
Handle< BindGroup_t > createBindGroup(
    const Handle< Device_t > & deviceHandle,
    const BindGroupOptions & options
)

function deleteBindGroup

1
2
3
void deleteBindGroup(
    const Handle< BindGroup_t > & handle
)

function getBindGroup

1
2
3
VulkanBindGroup * getBindGroup(
    const Handle< BindGroup_t > & handle
) const

function createBindGroupLayout

1
2
3
4
Handle< BindGroupLayout_t > createBindGroupLayout(
    const Handle< Device_t > & deviceHandle,
    const BindGroupLayoutOptions & options
)

function deleteBindGroupLayout

1
2
3
void deleteBindGroupLayout(
    const Handle< BindGroupLayout_t > & handle
)

function getBindGroupLayout

1
2
3
VulkanBindGroupLayout * getBindGroupLayout(
    const Handle< BindGroupLayout_t > & handle
) const

function createSampler

1
2
3
4
Handle< Sampler_t > createSampler(
    const Handle< Device_t > & deviceHandle,
    const SamplerOptions & options
)

function deleteSampler

1
2
3
void deleteSampler(
    const Handle< Sampler_t > & handle
)

function getSampler

1
2
3
VulkanSampler * getSampler(
    const Handle< Sampler_t > & handle
) const

function createFence

1
2
3
4
Handle< Fence_t > createFence(
    const Handle< Device_t > & deviceHandle,
    const FenceOptions & options
)

function deleteFence

1
2
3
void deleteFence(
    const Handle< Fence_t > & handle
)

function getFence

1
2
3
VulkanFence * getFence(
    const Handle< Fence_t > & handle
) const

function createAccelerationStructure

1
2
3
4
Handle< AccelerationStructure_t > createAccelerationStructure(
    const Handle< Device_t > & deviceHandle,
    const AccelerationStructureOptions & options
)

function deleteAccelerationStructure

1
2
3
void deleteAccelerationStructure(
    const Handle< AccelerationStructure_t > & handle
)

function getAccelerationStructure

1
2
3
VulkanAccelerationStructure * getAccelerationStructure(
    const Handle< AccelerationStructure_t > & handle
) const

function getMemoryStats

1
2
3
std::string getMemoryStats(
    const Handle< Device_t > & device
) const

function formatFromTextureView

1
2
3
KDGpu::Format formatFromTextureView(
    const Handle< TextureView_t > & viewHandle
) const

Updated on 2024-12-22 at 00:01:23 +0000