UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
VulkanCommandList.h
1#pragma once
2#include <UnCompute/Backend/CommandListBase.h>
3#include <UnCompute/Memory/Memory.h>
4#include <UnCompute/VulkanBackend/VulkanInclude.h>
5
6namespace UN
7{
8 class VulkanCommandList final : public CommandListBase
9 {
10 VkCommandBuffer m_CommandBuffer = VK_NULL_HANDLE;
11 VkCommandPool m_CommandPool = VK_NULL_HANDLE;
12 VkQueue m_Queue = VK_NULL_HANDLE;
13
14 protected:
15 ResultCode InitInternal(const CommandListDesc& desc) override;
16 ResultCode BeginInternal() override;
17 ResultCode EndInternal() override;
18 ResultCode ResetStateInternal() override;
19 ResultCode SubmitInternal() override;
20
21 void CmdMemoryBarrier(IBuffer* pBuffer, const MemoryBarrierDesc& barrierDesc) override;
22 void CmdCopy(IBuffer* pSource, IBuffer* pDestination, const BufferCopyRegion& region) override;
23 void CmdDispatch(IKernel* pKernel, Int32 x, Int32 y, Int32 z) override;
24
25 public:
26 explicit VulkanCommandList(IComputeDevice* pDevice);
27 ~VulkanCommandList() override;
28
29 CommandListState GetState() override;
30 void Reset() override;
31
32 inline static ResultCode Create(IComputeDevice* pDevice, ICommandList** ppCommandList)
33 {
34 *ppCommandList = AllocateObject<VulkanCommandList>(pDevice);
35 (*ppCommandList)->AddRef();
36 return ResultCode::Success;
37 }
38 };
39} // namespace UN
Definition: CommandListBase.h:9
An interface for backend-specific buffers that store the data on the device.
Definition: IBuffer.h:26
An interface for command lists that record commands to be executed by the backend.
Definition: ICommandList.h:180
Interface for all backend-specific compute devices.
Definition: IComputeDevice.h:38
An interface for compute kernel - a program running on the device.
Definition: IKernel.h:29
Definition: VulkanCommandList.h:9
CommandListState GetState() override
Get command list state.
Definition: VulkanCommandList.cpp:31
void Reset() override
Reset the object to uninitialized state.
Definition: VulkanCommandList.cpp:45
Region for buffer copy command.
Definition: ICommandList.h:65
Command list descriptor.
Definition: ICommandList.h:47
Memory barrier descriptor.
Definition: ICommandList.h:105