UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
VulkanResourceBinding.h
1#pragma once
2#include <UnCompute/Backend/ResourceBindingBase.h>
3#include <UnCompute/VulkanBackend/VulkanInclude.h>
4
5namespace UN
6{
8 {
9 VkDescriptorSetLayout m_SetLayout = VK_NULL_HANDLE;
10 VkDescriptorSet m_DescriptorSet = VK_NULL_HANDLE;
11
12 VkPipelineLayout m_PipelineLayout = VK_NULL_HANDLE;
13
14 protected:
15 ResultCode InitInternal(const DescriptorType& desc) override;
16
17 public:
18 explicit VulkanResourceBinding(IComputeDevice* pDevice);
19 ~VulkanResourceBinding() override;
20
21 ResultCode SetVariable(Int32 bindingIndex, IBuffer* pBuffer) override;
22
23 void Reset() override;
24
25 [[nodiscard]] inline VkPipelineLayout GetNativePipelineLayout() const
26 {
27 return m_PipelineLayout;
28 }
29
30 [[nodiscard]] inline VkDescriptorSet GetNativeDescriptorSet() const
31 {
32 return m_DescriptorSet;
33 }
34
35 static ResultCode Create(IComputeDevice* pDevice, IResourceBinding** ppResourceBinding);
36 };
37} // namespace UN
An interface for backend-specific buffers that store the data on the device.
Definition: IBuffer.h:26
Interface for all backend-specific compute devices.
Definition: IComputeDevice.h:38
Resource binding object used to bind resources to a compute kernel.
Definition: IResourceBinding.h:51
Definition: ResourceBindingBase.h:8
Definition: VulkanResourceBinding.h:8
void Reset() override
Reset the object to uninitialized state.
Definition: VulkanResourceBinding.cpp:37
ResultCode SetVariable(Int32 bindingIndex, IBuffer *pBuffer) override
Set kernel variable.
Definition: VulkanResourceBinding.cpp:109
Resource binding descriptor.
Definition: IResourceBinding.h:34