4#ifndef GREM_GRAPHICS_VERTEX_ATTRIBUTE_DESCRIPTION_HPP
5#define GREM_GRAPHICS_VERTEX_ATTRIBUTE_DESCRIPTION_HPP
168template <
typename TupleType>
169struct is_vertex_attributes : std::false_type {};
171template <
typename... Ts>
172struct is_vertex_attributes<
Tuple<Ts...>> : std::bool_constant<(vertex_attribute_value_type<std::remove_cvref_t<Ts>> && ...)> {};
174template <
typename TupleType>
175inline constexpr bool is_vertex_attributes_v = is_vertex_attributes<TupleType>::value;
189 detail::is_vertex_attributes_v<decltype(meta::getFields(std::declval<T>()))>;
201[[nodiscard]]
constexpr size_t getVertexAttributeSizeInBytes(
VertexAttributeType type)
noexcept {
248[[nodiscard]]
constexpr size_t getVertexAttributeSizeInBytes(
const VertexAttributeDescription& vertexAttributeDescription)
noexcept {
249 return getVertexAttributeSizeInBytes(vertexAttributeDescription.type);
252template <vertex_attribute_value_type T>
255 .type = detail::VERTEX_ATTRIBUTE_TYPE<T>,
260template <
typename VertexAttributeStruct>
261[[nodiscard]]
constexpr auto getVertexAttributeDescriptions() {
269template <
typename VertexAttributeStruct>
270inline constexpr auto VERTEX_ATTRIBUTE_DESCRIPTIONS = getVertexAttributeDescriptions<VertexAttributeStruct>();
Definition concepts.hpp:100
Concept that checks if a type is a valid vertex attribute struct type.
Definition VertexAttributeDescription.hpp:185
Concept that checks if a type is a valid value type for a vertex attribute.
Definition VertexAttributeDescription.hpp:29
Definition concepts.hpp:35
Definition concepts.hpp:109
Definition concepts.hpp:187
Definition buffer_layouts.hpp:20
@ U32
Unsigned 32-bit integer.
Definition Mesh.hpp:56
@ U16
Unsigned 16-bit integer.
Definition Mesh.hpp:55
VertexAttributeType
Specification of the underlying value type of a vertex attribute.
Definition VertexAttributeDescription.hpp:75
@ I8NORM
Definition VertexAttributeDescription.hpp:77
@ U32VEC3
Definition VertexAttributeDescription.hpp:111
@ I8VEC2
Definition VertexAttributeDescription.hpp:83
@ I16VEC4NORM
Definition VertexAttributeDescription.hpp:101
@ I16VEC4
Definition VertexAttributeDescription.hpp:103
@ U8VEC2NORM
Definition VertexAttributeDescription.hpp:80
@ U16VEC2
Definition VertexAttributeDescription.hpp:97
@ I32VEC3
Definition VertexAttributeDescription.hpp:112
@ I32VEC2
Definition VertexAttributeDescription.hpp:109
@ U32VEC4
Definition VertexAttributeDescription.hpp:114
@ I16VEC2NORM
Definition VertexAttributeDescription.hpp:96
@ F32
Definition VertexAttributeDescription.hpp:107
@ U8NORM
Definition VertexAttributeDescription.hpp:76
@ I16VEC2
Definition VertexAttributeDescription.hpp:98
@ F16
Definition VertexAttributeDescription.hpp:94
@ I8
Definition VertexAttributeDescription.hpp:79
@ U8
Definition VertexAttributeDescription.hpp:78
@ U8VEC2
Definition VertexAttributeDescription.hpp:82
@ UA2B10G10R10VEC4NORM
Definition VertexAttributeDescription.hpp:88
@ U8VEC4NORM
Definition VertexAttributeDescription.hpp:84
@ I8VEC2NORM
Definition VertexAttributeDescription.hpp:81
@ F16VEC4
Definition VertexAttributeDescription.hpp:104
@ U16VEC4
Definition VertexAttributeDescription.hpp:102
@ U16VEC2NORM
Definition VertexAttributeDescription.hpp:95
@ IA2B10G10R10VEC4NORM
Definition VertexAttributeDescription.hpp:89
@ U16VEC4NORM
Definition VertexAttributeDescription.hpp:100
@ I16
Definition VertexAttributeDescription.hpp:93
@ F32VEC4
Definition VertexAttributeDescription.hpp:116
@ U16NORM
Definition VertexAttributeDescription.hpp:90
@ U32
Definition VertexAttributeDescription.hpp:105
@ I32VEC4
Definition VertexAttributeDescription.hpp:115
@ I16NORM
Definition VertexAttributeDescription.hpp:91
@ F32VEC3
Definition VertexAttributeDescription.hpp:113
@ I32
Definition VertexAttributeDescription.hpp:106
@ F32VEC2
Definition VertexAttributeDescription.hpp:110
@ I8VEC4NORM
Definition VertexAttributeDescription.hpp:85
@ U32VEC2
Definition VertexAttributeDescription.hpp:108
@ F16VEC2
Definition VertexAttributeDescription.hpp:99
@ U16
Definition VertexAttributeDescription.hpp:92
@ U8VEC4
Definition VertexAttributeDescription.hpp:86
@ I8VEC4
Definition VertexAttributeDescription.hpp:87
Array(T, Us...) -> Array< T, 1+sizeof...(Us)>
vec< 2, uint16_t > u16vec2
Definition math.hpp:410
vec< 4, float > vec4
Definition math.hpp:440
vec< 4, i16norm > i16vec4norm
Definition math.hpp:468
vec< 3, uint32_t > u32vec3
Definition math.hpp:419
detail::NormalizedInteger< int16_t > i16norm
Definition fundamentals.hpp:378
vec< 2, float > vec2
Definition math.hpp:438
vec< 4, i8norm > i8vec4norm
Definition math.hpp:460
vec< 2, i16norm > i16vec2norm
Definition math.hpp:466
vec< 4, int32_t > i32vec4
Definition math.hpp:416
vec< 2, int8_t > i8vec2
Definition math.hpp:398
vec< 3, int32_t > i32vec3
Definition math.hpp:415
vec< 2, uint8_t > u8vec2
Definition math.hpp:402
vec< 4, int16_t > i16vec4
Definition math.hpp:408
detail::NormalizedInteger< uint8_t > u8norm
Definition fundamentals.hpp:377
detail::NormalizedInteger< uint16_t > u16norm
Definition fundamentals.hpp:379
vec< 3, float > vec3
Definition math.hpp:439
vec< 4, uint8_t > u8vec4
Definition math.hpp:404
Tuple(Ts...) -> Tuple< Ts... >
detail::NormalizedInteger< int8_t > i8norm
Definition fundamentals.hpp:376
vec< 4, u16norm > u16vec4norm
Definition math.hpp:472
vec< 4, uint16_t > u16vec4
Definition math.hpp:412
vec< 2, u16norm > u16vec2norm
Definition math.hpp:470
vec< 2, u8norm > u8vec2norm
Definition math.hpp:462
vec< 4, uint32_t > u32vec4
Definition math.hpp:420
void unreachable()
Definition assertions.hpp:125
vec< 2, int32_t > i32vec2
Definition math.hpp:414
vec< 4, u8norm > u8vec4norm
Definition math.hpp:464
vec< 2, float16_t > f16vec2
Definition math.hpp:446
vec< 4, float16_t > f16vec4
Definition math.hpp:448
vec< 2, i8norm > i8vec2norm
Definition math.hpp:458
vec< 2, uint32_t > u32vec2
Definition math.hpp:418
vec< 2, int16_t > i16vec2
Definition math.hpp:406
vec< 4, int8_t > i8vec4
Definition math.hpp:400
CStringViewBase< char, std::char_traits< char > > CStringView
Definition CStringView.hpp:635
Definition fundamentals.hpp:160
Description of a vertex attribute in a vertex atttribute struct.
Definition VertexAttributeDescription.hpp:194
VertexAttributeType type
Vertex attribute value type.
Definition VertexAttributeDescription.hpp:195
CStringView name
Identifier that the vertex attribute is accessed by in the shader source code.
Definition VertexAttributeDescription.hpp:196