Lugdunum  0.1.0
Buffer.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <set>
5 
7 
8 namespace lug {
9 namespace Graphics {
10 namespace Vulkan {
11 namespace API {
12 
13 class Device;
14 
15 namespace Builder {
16 
17 class Buffer {
18 public:
19  Buffer(const API::Device& device);
20 
21  Buffer(const Buffer&) = delete;
22  Buffer(Buffer&&) = delete;
23 
24  Buffer& operator=(const Buffer&) = delete;
25  Buffer& operator=(Buffer&&) = delete;
26 
27  ~Buffer() = default;
28 
29  // Setters
30  void setSize(VkDeviceSize size);
31  void setFlags(VkBufferCreateFlags flags);
32  void setUsage(VkBufferUsageFlags usage);
33  void setExclusive(bool exclusive);
34  void setQueueFamilyIndices(std::set<uint32_t> queueFamilyIndices);
35 
36  // Build methods
37  bool build(API::Buffer& instance, VkResult* returnResult = nullptr);
38  std::unique_ptr<API::Buffer> build(VkResult* returnResult = nullptr);
39 
40 private:
42  VkDeviceSize _size{};
43  VkBufferCreateFlags _flags{};
44  bool _exclusive{false};
45  VkBufferUsageFlags _usage{};
46  std::set<uint32_t> _queueFamilyIndices{};
47 };
48 
50 
51 } // Builder
52 } // API
53 } // Vulkan
54 } // Graphics
55 } // lug
void setFlags(VkBufferCreateFlags flags)
Definition: Buffer.inl:5
Buffer(const API::Device &device)
Definition: Buffer.cpp:13
void setQueueFamilyIndices(std::set< uint32_t > queueFamilyIndices)
Definition: Buffer.inl:17
bool build(API::Buffer &instance, VkResult *returnResult=nullptr)
Definition: Buffer.cpp:15
void setSize(VkDeviceSize size)
Definition: Buffer.inl:1
std::set< uint32_t > _queueFamilyIndices
Definition: Buffer.hpp:46
void setUsage(VkBufferUsageFlags usage)
Definition: Buffer.inl:9
Buffer & operator=(const Buffer &)=delete