65 uint32_t max_offset = 0;
66 uint32_t last_size = 0;
70 max_offset = std::max(max_offset, attr.offset_in_vertex);
71 if (attr.offset_in_vertex == max_offset) {
72 last_size = attr_size;
91 .offset_in_vertex = 0,
92 .name =
"position" });
96 .offset_in_vertex = 12,
101 .offset_in_vertex = 24,
118 .offset_in_vertex = 0,
119 .name =
"position" });
123 .offset_in_vertex = 12,
128 .offset_in_vertex = 24,
129 .name =
"thickness" });
133 .offset_in_vertex = 28,
147 layout.
stride_bytes =
static_cast<uint32_t
>(
sizeof(glm::vec3) +
sizeof(glm::vec2));
151 .offset_in_vertex = 0,
152 .name =
"position" });
156 .offset_in_vertex =
static_cast<uint32_t
>(
sizeof(glm::vec3)),
157 .name =
"texcoord" });
174 return sizeof(glm::vec3);
177 return sizeof(glm::vec2);
180 return sizeof(glm::vec4);
184 return sizeof(double);
DataModality
Data modality types for cross-modal analysis.
@ AUDIO_MULTICHANNEL
Multi-channel audio.
@ AUDIO_1D
1D audio signal
@ SCALAR_F32
Single-channel float data.
std::string name
Optional name for debugging/introspection e.g., "position", "normal", "texCoord".
uint32_t offset_in_vertex
Byte offset of this attribute within one vertex e.g., position at 0, normal at 12,...
DataModality component_modality
Semantic type of this attribute e.g., VERTEX_POSITIONS_3D → vec3, TEXTURE_COORDS_2D → vec2.
Semantic description of a single vertex attribute.
uint32_t stride_bytes
Total bytes per vertex (stride in Vulkan terms) e.g., 3 floats (position) + 3 floats (normal) = 24 by...
uint32_t vertex_count
Total number of vertices in this buffer.
static VertexLayout for_textured_quad(uint32_t vertex_count=4)
Factory: Create layout for textured quad primitives (position, texcoord).
static uint32_t modality_size_bytes(DataModality mod)
Get size in bytes for a given modality Mirrors VKBuffer::get_format() logic.
void compute_stride()
Helper: compute stride from attributes if not explicitly set.
static VertexLayout for_points(uint32_t stride=28)
Factory: Create layout for point primitives (position, color, size)
std::vector< VertexAttributeLayout > attributes
All attributes that make up one vertex Ordered by shader location (0, 1, 2, ...)
static VertexLayout for_lines(uint32_t stride=36)
Factory: Create layout for line primitives (position, color, thickness)
Complete description of vertex data layout in a buffer.