1#ifndef LIBSBX_GRAPHICS_BUFFERS_STORAGE_BUFFER_HPP_
2#define LIBSBX_GRAPHICS_BUFFERS_STORAGE_BUFFER_HPP_
4#include <libsbx/units/bytes.hpp>
6#include <libsbx/memory/observer_ptr.hpp>
8#include <libsbx/graphics/descriptor/descriptor.hpp>
10#include <libsbx/graphics/buffers/buffer.hpp>
12#include <libsbx/graphics/resource_storage.hpp>
14namespace sbx::graphics {
20 inline static constexpr auto max_size = units::quantity_cast<units::byte>(
units::kibibyte{512});
21 inline static constexpr auto min_size = units::quantity_cast<units::byte>(
units::kibibyte{16});
31 template<
typename Type>
32 auto read(
const std::size_t index)
const ->
const Type& {
33 return *(
static_cast<const Type*
>(_mapped_memory.get()) + index *
sizeof(Type));
38 static auto create_descriptor_set_layout_binding(std::uint32_t binding, VkDescriptorType descriptor_type, VkShaderStageFlags stage_flags)
noexcept -> VkDescriptorSetLayoutBinding;
Definition: buffer.hpp:20
Definition: descriptor.hpp:37
Definition: resource_storage.hpp:17
Definition: storage_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
Definition: quantity.hpp:65