2#ifndef LIBSBX_GRAPHICS_BUFFERS_STORAGE_BUFFER_HPP_
3#define LIBSBX_GRAPHICS_BUFFERS_STORAGE_BUFFER_HPP_
5#include <libsbx/units/bytes.hpp>
7#include <libsbx/memory/observer_ptr.hpp>
9#include <libsbx/graphics/descriptor/descriptor.hpp>
11#include <libsbx/graphics/buffers/buffer.hpp>
13#include <libsbx/graphics/resource_storage.hpp>
15namespace sbx::graphics {
21 inline static constexpr auto max_size = units::quantity_cast<units::byte>(
units::kibibyte{512});
22 inline static constexpr auto min_size = units::quantity_cast<units::byte>(
units::kibibyte{16});
32 template<
typename Type>
33 auto read(
const std::size_t index)
const ->
const Type& {
34 return *(
static_cast<const Type*
>(_mapped_memory.get()) + index *
sizeof(Type));
37 auto name()
const noexcept -> std::string
override {
38 return "Storage Buffer";
43 static auto create_descriptor_set_layout_binding(std::uint32_t binding, VkDescriptorType descriptor_type, VkShaderStageFlags stage_flags)
noexcept -> VkDescriptorSetLayoutBinding;
Definition: buffer.hpp:21
Definition: descriptor.hpp:38
Definition: resource_storage.hpp:18
Definition: storage_buffer.hpp:17
Definition: descriptor.hpp:13
A non-owning pointer that can be used to observe the value of a pointer.
Definition: observer_ptr.hpp:28
Definition: quantity.hpp:66