Lugdunum  0.1.0
Queue.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 #include <mutex>
7 
8 namespace lug {
9 namespace Graphics {
10 namespace Vulkan {
11 namespace API {
12 
13 class CommandBuffer;
14 class QueueFamily;
15 
17 public:
18  explicit Queue(VkQueue queue = VK_NULL_HANDLE, const QueueFamily* queueFamily = nullptr);
19 
20  Queue(const Queue&) = delete;
21  Queue(Queue&& queue);
22 
23  Queue& operator=(const Queue&) = delete;
24  Queue& operator=(Queue&& queue);
25 
26  ~Queue() = default;
27 
28  explicit operator VkQueue() const {
29  return _queue;
30  }
31 
32  bool submit(const CommandBuffer& commandBuffer,
33  const std::vector<VkSemaphore>& signalSemaphores = {},
34  const std::vector<VkSemaphore>& waitSemaphores = {},
35  const std::vector<VkPipelineStageFlags>& waitDstStageMasks = {},
36  VkFence fence = VK_NULL_HANDLE
37  ) const;
38 
39  bool waitIdle() const;
40 
41  const QueueFamily* getQueueFamily() const;
42 
43 private:
44  VkQueue _queue{VK_NULL_HANDLE};
45 
46  const QueueFamily* _queueFamily{nullptr};
47  mutable std::mutex _mutex;
48 };
49 
50 } // API
51 } // Vulkan
52 } // Graphics
53 } // lug
#define LUG_GRAPHICS_API
Definition: Export.hpp:11