mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2025-10-30 07:01:10 +00:00
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
#ifndef DESCRIPTORPOOL_HPP
|
|
#define DESCRIPTORPOOL_HPP
|
|
|
|
#include "core/device.hpp"
|
|
|
|
#include <vulkan/vulkan_core.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace LSFG::Core {
|
|
|
|
///
|
|
/// C++ wrapper class for a Vulkan descriptor pool.
|
|
///
|
|
/// This class manages the lifetime of a Vulkan descriptor pool.
|
|
///
|
|
class DescriptorPool {
|
|
public:
|
|
DescriptorPool() noexcept = default;
|
|
|
|
///
|
|
/// Create the descriptor pool.
|
|
///
|
|
/// @param device Vulkan device
|
|
///
|
|
/// @throws LSFG::vulkan_error if object creation fails.
|
|
///
|
|
DescriptorPool(const Core::Device& device);
|
|
|
|
/// Get the Vulkan handle.
|
|
[[nodiscard]] auto handle() const { return *this->descriptorPool; }
|
|
|
|
/// Trivially copyable, moveable and destructible
|
|
DescriptorPool(const DescriptorPool&) noexcept = default;
|
|
DescriptorPool& operator=(const DescriptorPool&) noexcept = default;
|
|
DescriptorPool(DescriptorPool&&) noexcept = default;
|
|
DescriptorPool& operator=(DescriptorPool&&) noexcept = default;
|
|
~DescriptorPool() = default;
|
|
private:
|
|
std::shared_ptr<VkDescriptorPool> descriptorPool;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // DESCRIPTORPOOL_HPP
|