11#ifdef CORRELATION_USE_VULKAN
12#include <vulkan/vulkan.h>
20#ifdef CORRELATION_USE_VULKAN
28 VulkanDevice() noexcept = default;
29 ~VulkanDevice() noexcept { destroy(); }
31 VulkanDevice(
const VulkanDevice &) =
delete;
32 VulkanDevice &operator=(
const VulkanDevice &) =
delete;
34 VulkanDevice(VulkanDevice &&other)
noexcept { moveFrom(other); }
35 VulkanDevice &operator=(VulkanDevice &&other)
noexcept {
47 [[nodiscard]]
bool initialize();
52 void destroy() noexcept;
58 [[nodiscard]] VkCommandBuffer beginSingleTimeCommands();
64 void endSingleTimeCommands(VkCommandBuffer command_buffer);
66 [[nodiscard]] VkInstance instance() const noexcept {
return instance_; }
67 [[nodiscard]] VkPhysicalDevice physicalDevice() const noexcept {
return physical_device_; }
68 [[nodiscard]] VkDevice device() const noexcept {
return device_; }
69 [[nodiscard]] VkQueue graphicsQueue() const noexcept {
return graphics_queue_; }
70 [[nodiscard]] uint32_t queueFamilyIndex() const noexcept {
return queue_family_index_; }
71 [[nodiscard]] VkCommandPool commandPool() const noexcept {
return command_pool_; }
72 [[nodiscard]]
bool isValid() const noexcept {
return device_ != VK_NULL_HANDLE; }
73 [[nodiscard]] std::string physicalDeviceName()
const;
76 void moveFrom(VulkanDevice &other)
noexcept;
77 [[nodiscard]]
bool createInstance();
78 [[nodiscard]]
bool pickPhysicalDevice();
79 [[nodiscard]]
bool createLogicalDevice();
80 [[nodiscard]]
bool createCommandPool();
82 VkInstance instance_{VK_NULL_HANDLE};
83 VkPhysicalDevice physical_device_{VK_NULL_HANDLE};
84 VkDevice device_{VK_NULL_HANDLE};
85 VkQueue graphics_queue_{VK_NULL_HANDLE};
86 uint32_t queue_family_index_{0};
87 VkCommandPool command_pool_{VK_NULL_HANDLE};
Definition VulkanComputeService.hpp:24