33#ifndef DVD_COMMAND_BUFFER_H_
34#define DVD_COMMAND_BUFFER_H_
38struct GenericDrawCommand;
65 "MISSING_BEGIN_RENDER_PASS",
66 "INVALID_BEGIN_RENDER_PASS",
67 "MISSING_END_RENDER_PASS",
68 "MISSING_BEGIN_GPU_QUERY",
69 "MISSING_END_GPU_QUERY",
70 "MISSING_PUSH_DEBUG_SCOPE",
71 "MISSING_POP_DEBUG_SCOPE",
73 "MISSING_POP_VIEWPORT",
74 "MISSING_VALID_PIPELINE",
75 "MISSING_BLIT_DESCRIPTOR_SET",
76 "INVALID_DISPATCH_COUNT",
77 "INVALID_DESCRIPTOR_SET",
78 "INVALID_RENDER_PASS_FOR_PIPELINE",
89struct MemoryBarrierCommand;
90struct SendPushConstantsCommand;
113 using CommandList = eastl::fixed_vector<CommandBase*, COMMAND_BUFFER_INIT_SIZE, true>;
118 template<
typename T>
requires std::is_base_of_v<CommandBase, T>
120 template<
typename T>
requires std::is_base_of_v<CommandBase, T>
121 T*
add(
const T& command);
122 template<
typename T>
requires std::is_base_of_v<CommandBase, T>
131 void clear(
const char* name,
size_t reservedCmdCount);
134 [[nodiscard]]
string toString()
const;
137 [[nodiscard]] std::pair<ErrorType, size_t>
validate()
const;
154template<
typename T = CommandBase>
requires std::is_base_of_v<CommandBase, T>
161template<
typename T>
requires std::is_base_of_v<CommandBase, T>
164template<
typename T>
requires std::is_base_of_v<CommandBase, T>
167template<
typename T>
requires std::is_base_of_v<CommandBase, T>
eastl::fixed_vector< CommandBase *, COMMAND_BUFFER_INIT_SIZE, true > CommandList
PROPERTY_R(CommandList, commands)
static constexpr U32 COMMAND_BUFFER_INIT_SIZE
string toString() const
Multi-line. indented list of all commands (and params for some of them)
std::pair< ErrorType, size_t > validate() const
Verify that the commands in the buffer are valid and in the right order.
static const char * errorType[]
void ToString(const CommandBase &cmd, const CommandType type, I32 &crtIndent, string &out)
void AddCommandBufferToQueue(CommandBufferQueue &queue, const Handle< GFX::CommandBuffer > &commandBuffer)
void ResetCommandBufferQueue(CommandBufferQueue &queue)
bool BatchDrawCommands(GenericDrawCommand &previousGDC, GenericDrawCommand ¤tGDC) noexcept
FORCE_INLINE T * EnqueueCommand(CommandBuffer &buffer)
@ MISSING_PUSH_DEBUG_SCOPE
@ INVALID_RENDER_PASS_FOR_PIPELINE
@ MISSING_POP_DEBUG_SCOPE
@ MISSING_BEGIN_RENDER_PASS
@ MISSING_BLIT_DESCRIPTOR_SET
@ INVALID_BEGIN_RENDER_PASS
@ MISSING_END_RENDER_PASS
@ MISSING_BEGIN_GPU_QUERY
bool Merge(DrawCommand *prevCommand, DrawCommand *crtCommand)
bool TryMergeCommands(CommandType type, T *prevCommand, T *crtCommand)
Handle console commands that start with a forward slash.
constexpr auto to_base(const Type value) -> Type
Handle< GFX::CommandBuffer > _buffer
static constexpr U32 COMMAND_BUFFER_INIT_SIZE
eastl::fixed_vector< Entry, COMMAND_BUFFER_INIT_SIZE, true > _commandBuffers