sandbox
Loading...
Searching...
No Matches
uniform_buffer.hpp
1#ifndef LIBSBX_GRAPHICS_BUFFERS_UNIFORM_BUFFER_HPP_
2#define LIBSBX_GRAPHICS_BUFFERS_UNIFORM_BUFFER_HPP_
3
4#include <vulkan/vulkan.hpp>
5
6#include <libsbx/memory/observer_ptr.hpp>
7
8#include <libsbx/graphics/buffers/buffer.hpp>
9
10#include <libsbx/graphics/descriptor/descriptor.hpp>
11
12#include <libsbx/graphics/resource_storage.hpp>
13
14namespace sbx::graphics {
15
16class uniform_buffer : public buffer, public descriptor {
17
18public:
19
20 uniform_buffer(VkDeviceSize size, memory::observer_ptr<void> data = nullptr);
21
22 ~uniform_buffer() override;
23
24 auto mapped_memory() const noexcept -> memory::observer_ptr<void>;
25
26 auto update(memory::observer_ptr<const void> data, VkDeviceSize size, VkDeviceSize offset = 0) -> void;
27
28 auto write_descriptor_set(std::uint32_t binding, VkDescriptorType descriptor_type) const noexcept -> graphics::write_descriptor_set override;
29
30 static auto create_descriptor_set_layout_binding(std::uint32_t binding, VkDescriptorType descriptor_type, VkShaderStageFlags stage_flags) noexcept -> VkDescriptorSetLayoutBinding;
31
32}; // class uniform_buffer
33
35
36} // namespace sbx::graphics
37
38#endif // LIBSBX_GRAPHICS_BUFFERS_UNIFORM_BUFFER_HPP_
Definition: buffer.hpp:20
Definition: descriptor.hpp:37
Definition: uniform_buffer.hpp:16
Definition: descriptor.hpp:12
A non-owning pointer that can be used to observe the value of a pointer.
Definition: observer_ptr.hpp:27