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;
99 .offset_in_vertex = 0,
100 .name =
"position" });
103 .offset_in_vertex = 12,
107 .offset_in_vertex = 24,
111 .offset_in_vertex = 28,
115 .offset_in_vertex = 36,
119 .offset_in_vertex = 48,
120 .name =
"tangent" });
144 .offset_in_vertex = 0,
145 .name =
"position" });
148 .offset_in_vertex = 12,
152 .offset_in_vertex = 24,
153 .name =
"thickness" });
156 .offset_in_vertex = 28,
160 .offset_in_vertex = 36,
164 .offset_in_vertex = 48,
165 .name =
"tangent" });
191 .offset_in_vertex = 0,
192 .name =
"position" });
195 .offset_in_vertex = 12,
199 .offset_in_vertex = 24,
203 .offset_in_vertex = 28,
207 .offset_in_vertex = 36,
211 .offset_in_vertex = 48,
212 .name =
"tangent" });
226 layout.
stride_bytes =
static_cast<uint32_t
>(
sizeof(glm::vec3) +
sizeof(glm::vec2));
230 .offset_in_vertex = 0,
231 .name =
"position" });
235 .offset_in_vertex =
static_cast<uint32_t
>(
sizeof(glm::vec3)),
236 .name =
"texcoord" });
253 return sizeof(glm::vec3);
256 return sizeof(glm::vec2);
259 return sizeof(glm::vec4);
263 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_lines(uint32_t stride=60)
Factory: layout for LineVertex (position, color, thickness, uv, normal, tangent)
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_meshes(uint32_t stride=60)
Factory: layout for MeshVertex (position, color, weight, uv, normal, tangent)
std::vector< VertexAttributeLayout > attributes
All attributes that make up one vertex Ordered by shader location (0, 1, 2, ...)
static VertexLayout for_points(uint32_t stride=60)
Factory: layout for PointVertex (position, color, size, uv, normal, tangent)
Complete description of vertex data layout in a buffer.