MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
LayoutTranslator.hpp
Go to the documentation of this file.
1#pragma once
2
5
7
8/**
9 * @class VertexLayoutTranslator
10 * @brief Translates semantic vertex layouts to Vulkan pipeline state
11 *
12 * Bridges the gap between Kakshya data semantics and Vulkan's
13 * VkVertexInputBindingDescription / VkVertexInputAttributeDescription.
14 *
15 * All Vulkan type translation happens here. Keeps VKBuffer pure semantic.
16 */
17class MAYAFLUX_API VertexLayoutTranslator {
18public:
19 /**
20 * @brief Convert semantic modality to Vulkan format
21 * @param modality Kakshya::DataModality
22 * @return Corresponding vk::Format
23 */
24 static vk::Format modality_to_vk_format(Kakshya::DataModality modality);
25
26 /**
27 * @brief Translate a semantic vertex layout to Vulkan binding/attribute descriptions
28 * @param layout Semantic vertex layout from VKBuffer
29 * @param binding_index Vulkan binding point (usually 0)
30 * @return Pair of (bindings, attributes) ready for VkPipelineVertexInputStateCreateInfo
31 */
32 static std::pair<
33 std::vector<Core::VertexBinding>,
34 std::vector<Core::VertexAttribute>>
35 translate_layout(
36 const Kakshya::VertexLayout& layout,
37 uint32_t binding_index = 0);
38
39 /**
40 * @brief Get size in bytes for a modality
41 * Useful for computing strides, offsets, etc.
42 */
43 static uint32_t get_modality_size_bytes(Kakshya::DataModality modality);
44
45 /**
46 * @brief Describe a modality in human-readable form
47 * e.g., "vec3" for VERTEX_POSITIONS_3D
48 */
49 static std::string_view describe_modality(Kakshya::DataModality modality);
50};
51
52} // namespace MayaFlux::Portal::Graphics
Translates semantic vertex layouts to Vulkan pipeline state.
DataModality
Data modality types for cross-modal analysis.
Definition NDData.hpp:78
Complete description of vertex data layout in a buffer.