Files
NazaraEngine/include/Nazara/Vulkan/VkCommandPool.hpp
Lynix 405e873294 Vulkan: Make device objects take a DeviceHandle at creation
Former-commit-id: 0c9724fac593d562dd0ef6fbdf10b2cad9494ac7 [formerly 05c1e582989afde033ac6cee4def19859246167b]
Former-commit-id: 4730597d196d8841c395a1cfe101bca70caa4a5e
2016-06-13 19:53:46 +02:00

54 lines
1.8 KiB
C++

// Copyright (C) 2016 Jérôme Leclercq
// This file is part of the "Nazara Engine - Vulkan"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_VULKAN_VKCOMMANDPOOL_HPP
#define NAZARA_VULKAN_VKCOMMANDPOOL_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/HandledObject.hpp>
#include <Nazara/Vulkan/VkDeviceObject.hpp>
namespace Nz
{
namespace Vk
{
class CommandBuffer;
class CommandPool;
using CommandPoolHandle = ObjectHandle<CommandPool>;
class NAZARA_VULKAN_API CommandPool : public DeviceObject<CommandPool, VkCommandPool, VkCommandPoolCreateInfo>, public HandledObject<CommandPool>
{
friend DeviceObject;
public:
CommandPool() = default;
CommandPool(const CommandPool&) = delete;
CommandPool(CommandPool&&) = default;
~CommandPool() = default;
CommandBuffer AllocateCommandBuffer(VkCommandBufferLevel level);
std::vector<CommandBuffer> AllocateCommandBuffers(UInt32 commandBufferCount, VkCommandBufferLevel level);
using DeviceObject::Create;
inline bool Create(const DeviceHandle& device, UInt32 queueFamilyIndex, VkCommandPoolCreateFlags flags = 0, const VkAllocationCallbacks* allocator = nullptr);
inline bool Reset(VkCommandPoolResetFlags flags);
CommandPool& operator=(const CommandPool&) = delete;
CommandPool& operator=(CommandPool&&) = delete;
private:
static inline VkResult CreateHelper(const DeviceHandle& device, const VkCommandPoolCreateInfo* createInfo, const VkAllocationCallbacks* allocator, VkCommandPool* handle);
static inline void DestroyHelper(const DeviceHandle& device, VkCommandPool handle, const VkAllocationCallbacks* allocator);
};
}
}
#include <Nazara/Vulkan/VkCommandPool.inl>
#endif // NAZARA_VULKAN_VKCOMMANDPOOL_HPP