MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ MeshBuffer() [1/2]

MayaFlux::Buffers::MeshBuffer::MeshBuffer ( Kakshya::MeshData  data)
explicit

Construct from an owning MeshData.

The VKBuffer base is sized to vertex_bytes. MeshProcessor allocates the index buffer separately on on_attach.

Parameters
dataLoaded or generated mesh. Must be valid (is_valid() == true).

Definition at line 19 of file MeshBuffer.cpp.

20 : VKBuffer(
21 [&data]() -> size_t {
22 const auto* vb = std::get_if<std::vector<uint8_t>>(
23 &data.vertex_variant);
24 return vb ? vb->size() : 0;
25 }(),
28 , m_mesh_data(std::move(data))
29{
30 if (!m_mesh_data.is_valid()) {
32 "MeshBuffer constructed with invalid MeshData — "
33 "GPU upload will be skipped until valid data is provided");
34 }
35
36 RenderConfig defaults;
37 defaults.vertex_shader = "triangle.vert.spv";
40
42
44 "MeshBuffer: {} vertices, {} indices ({} faces), stride {} bytes",
49}
#define MF_INFO(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
uint32_t get_index_count() const noexcept
Kakshya::MeshData m_mesh_data
Portal::Graphics::RenderConfig RenderConfig
Definition VKBuffer.hpp:69
void set_needs_depth_attachment(bool needs)
Mark this buffer as requiring depth testing when rendered.
Definition VKBuffer.hpp:565
void set_default_render_config(const RenderConfig &config)
Called by derived classes to set their context-specific defaults.
Definition VKBuffer.hpp:595
@ Init
Engine/subsystem initialization.
@ Buffers
Buffers, Managers, processors and processing chains.
uint32_t vertex_count() const noexcept
Number of vertices derived from vertex byte count and layout stride.
Definition MeshData.hpp:78
bool is_valid() const noexcept
True when both variants are non-empty and layout stride is set.
Definition MeshData.hpp:65
uint32_t face_count() const noexcept
Number of triangles (index count / 3).
Definition MeshData.hpp:93
uint32_t stride_bytes
Total bytes per vertex (stride in Vulkan terms) e.g., 3 floats (position) + 3 floats (normal) = 24 by...