UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
CommandListBase.h
1#pragma once
2#include <UnCompute/Backend/DeviceObjectBase.h>
3#include <UnCompute/Backend/ICommandList.h>
4#include <UnCompute/Backend/IFence.h>
5
6namespace UN
7{
8 class CommandListBase : public DeviceObjectBase<ICommandList>
9 {
10 protected:
11 CommandListState m_State = CommandListState::Invalid;
12 Ptr<IFence> m_pFence;
13
14 virtual ResultCode InitInternal(const CommandListDesc& desc) = 0;
15 virtual ResultCode BeginInternal() = 0;
16 virtual ResultCode EndInternal() = 0;
17 virtual ResultCode ResetStateInternal() = 0;
18 virtual ResultCode SubmitInternal() = 0;
19
20 void End() override;
21
22 inline explicit CommandListBase(IComputeDevice* pDevice)
23 : DeviceObjectBase(pDevice)
24 {
25 }
26
27 public:
28 ResultCode Init(const CommandListDesc& desc) override;
29
30 IFence* GetFence() override;
31
32 CommandListBuilder Begin() override;
33 void ResetState() override;
34 ResultCode Submit() override;
35 };
36} // namespace UN
Definition: CommandListBase.h:9
void ResetState() override
Set the command list state to CommandListState::Initial.
Definition: CommandListBase.cpp:30
ResultCode Submit() override
Submit the command list and set the state to CommandListState::Pending.
Definition: CommandListBase.cpp:42
IFence * GetFence() override
Get the fence that is signaled after submit operation is complete.
Definition: CommandListBase.cpp:68
CommandListBuilder Begin() override
Set the command list state to CommandListState::Recording.
Definition: CommandListBase.cpp:12
Command list builder, used for device command recording.
Definition: ICommandList.h:131
Base class for all compute backend objects.
Definition: DeviceObjectBase.h:18
Interface for all backend-specific compute devices.
Definition: IComputeDevice.h:38
An interface for fences - synchronization primitives that can be either signaled or reset.
Definition: IFence.h:31
Shared smart pointer implementation that uses reference counting.
Definition: Ptr.h:44
Command list descriptor.
Definition: ICommandList.h:47