32#ifndef DVD_COMMAND_BUFFER_INL_
33#define DVD_COMMAND_BUFFER_INL_
41struct BindShaderResourcesCommand;
42struct SendPushConstantsCommand;
46 template<
typename T>
requires std::is_base_of_v<CommandBase, T>
49 constexpr size_t g_commandSize =
prevPOW2(
sizeof( T ) );
51 if constexpr ( std::is_same<T, GFX::BindShaderResourcesCommand>::value )
53 return g_commandSize * (1u << 5);
55 else if constexpr ( std::is_same<T, GFX::DrawCommand>::value )
57 return g_commandSize * (1u << 6);
60 return g_commandSize * (1u << 4);
63 template<
typename T>
requires std::is_base_of_v<CommandBase, T>
66 using Pool = MemoryPool<T, MemoryPoolSize<T>()>;
76template<
typename T>
requires std::is_base_of_v<CommandBase, T>
79 T* mem = CmdAllocator<T>::GetPool().newElement();
80 _commands.emplace_back(mem);
84template<
typename T>
requires std::is_base_of_v<CommandBase, T>
87 T* mem = CmdAllocator<T>::GetPool().newElement(command);
88 _commands.emplace_back( mem );
92template<
typename T>
requires std::is_base_of_v<CommandBase, T>
95 T* mem = CmdAllocator<T>::GetPool().newElement(
MOV(command) );
96 _commands.emplace_back( mem );
100template<
typename T>
requires std::is_base_of_v<CommandBase, T>
106 assert(prevCommand !=
nullptr && crtCommand !=
nullptr);
#define PROFILE_SCOPE_AUTO(CATEGORY)
constexpr size_t MemoryPoolSize()
bool Merge(DrawCommand *prevCommand, DrawCommand *crtCommand)
bool TryMergeCommands(CommandType type, T *prevCommand, T *crtCommand)
constexpr Optick::Category::Type Graphics
Handle console commands that start with a forward slash.
constexpr U32 prevPOW2(U32 n) noexcept
MemoryPool< T, MemoryPoolSize< T >()> Pool