initial commit
This commit is contained in:
41
include/iwa/command.hpp
Normal file
41
include/iwa/command.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(IWA_COMMAND_HPP_INCLUDED)
|
||||
#define IWA_COMMAND_HPP_INCLUDED
|
||||
|
||||
#include "iwa/object.hpp"
|
||||
#include "iwa/vkwrapper.hpp"
|
||||
|
||||
namespace iwa
|
||||
{
|
||||
struct CommandPoolCreationArgs
|
||||
{
|
||||
vk::CommandPoolCreateFlags flags;
|
||||
std::uint32_t queueFamilyIndex;
|
||||
};
|
||||
|
||||
struct CommandBufferAllocateArgs
|
||||
{
|
||||
vk::CommandBufferLevel level = vk::CommandBufferLevel::ePrimary;
|
||||
};
|
||||
|
||||
class CommandPool : public Object<CommandPool, BaseObject, class Device>, public MixinVulkanObject<vk::CommandPool>
|
||||
{
|
||||
public:
|
||||
CommandPool(ObjectPtr<class Device> owner, CommandPoolCreationArgs args);
|
||||
~CommandPool() noexcept override;
|
||||
|
||||
[[nodiscard]] ObjectPtr<class CommandBuffer> allocateCommandBuffer(const CommandBufferAllocateArgs& args = {});
|
||||
// [[nodiscard]] std::vector<vk::CommandBuffer> allocateCommandBuffers(std::size_t count, const CommandBufferAllocateArgs& args = {}) const noexcept;
|
||||
};
|
||||
|
||||
class CommandBuffer : public Object<CommandBuffer, BaseObject, CommandPool>, public MixinVulkanObject<vk::CommandBuffer>
|
||||
{
|
||||
public:
|
||||
CommandBuffer(ObjectPtr<CommandPool> owner, vk::CommandBuffer handle);
|
||||
~CommandBuffer() noexcept override;
|
||||
};
|
||||
} // namespace iwa
|
||||
|
||||
#endif // !defined(IWA_COMMAND_HPP_INCLUDED)
|
||||
Reference in New Issue
Block a user