4#ifndef GREM_GRAPHICS_BUFFER_LAYOUTS_HPP
5#define GREM_GRAPHICS_BUFFER_LAYOUTS_HPP
93 return static_cast<uint32_t
>(
nameCRC32) <=>
static_cast<uint32_t
>(other.nameCRC32);
105template <
typename ParameterStruct, ConstantString Name>
113 return {.name = Name, .parameterDescriptions = detail::PARAMETER_DESCRIPTIONS<ParameterStruct>};
124template <
typename FieldStruct, ConstantString Name>
132 return {.name = Name, .fieldDescriptions = detail::FIELD_DESCRIPTIONS<FieldStruct>};
138template <
typename... Buffers>
140 ConstantString<char, ((Buffers::NAME.size() + 2) + ...)> result{};
143 for (
const CStringView name : {Buffers::NAME...}) {
144 for (
const char ch : name) {
147 if (i + 2 < result.
size()) {
157template <
typename... Buffers>
158inline constexpr Array<BufferLayoutReference,
sizeof...(Buffers)> BUFFER_LAYOUT_REFERENCES{Buffers::LAYOUT_REFERENCE...};
167template <
typename... Buffers>
176 .name = detail::BUFFER_SET_NAME<Buffers...>,
177 .bufferLayouts = detail::BUFFER_LAYOUT_REFERENCES<Buffers...>,
#define GREM_ASSERT(expression)
Definition assertions.hpp:77
Definition ConstantString.hpp:40
constexpr size_type size() const noexcept
Definition ConstantString.hpp:127
friend class Variant
Definition Variant.hpp:1402
Definition buffer_layouts.hpp:20
Array(T, Us...) -> Array< T, 1+sizeof...(Us)>
CStringViewBase< char, std::char_traits< char > > CStringView
Definition CStringView.hpp:635
Generic type-erased read-only reference to a buffer or buffer set layout.
Definition buffer_layouts.hpp:43
constexpr BufferLayoutReference(StorageBufferLayoutReference storageBufferLayout) noexcept
Construct a reference to a storage buffer layout.
Definition buffer_layouts.hpp:60
constexpr BufferLayoutReference(BufferSetLayoutReference bufferSetLayout) noexcept
Construct a reference to a buffer set layout.
Definition buffer_layouts.hpp:69
constexpr bool operator==(const BufferLayoutReference &other) const noexcept
Compare this buffer layout reference to another for equality.
Definition buffer_layouts.hpp:81
constexpr BufferLayoutReference(UniformBufferLayoutReference uniformBufferLayout) noexcept
Construct a reference to a uniform buffer layout.
Definition buffer_layouts.hpp:51
constexpr std::strong_ordering operator<=>(const BufferLayoutReference &other) const noexcept
Compare this buffer layout reference to another.
Definition buffer_layouts.hpp:92
CRC32 nameCRC32
CRC32 of the buffer name, used as a unique ID for the buffer type.
Definition buffer_layouts.hpp:44
Type-erased read-only reference to a BufferSetLayout.
Definition buffer_layouts.hpp:37
CStringView name
Unique name of the buffer set.
Definition buffer_layouts.hpp:38
Span< const BufferLayoutReference > bufferLayouts
Read-only view over the buffer layout references of the buffers in the set.
Definition buffer_layouts.hpp:39
Layout description of a BufferSet.
Definition buffer_layouts.hpp:168
Type-erased read-only reference to a StorageBufferLayout.
Definition buffer_layouts.hpp:29
CStringView name
Unique name of the storage buffer.
Definition buffer_layouts.hpp:30
Span< const FieldDescription > fieldDescriptions
Read-only view over the field descriptions of the field struct stored by the buffer.
Definition buffer_layouts.hpp:31
Layout description of a StorageBuffer.
Definition buffer_layouts.hpp:125