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

◆ upload_vertex()

void MayaFlux::Buffers::DataWriteProcessor::upload_vertex ( const std::shared_ptr< VKBuffer > &  vk,
std::vector< Kakshya::DataVariant > &  slots 
)
private

Definition at line 211 of file DataWriteProcessor.cpp.

212{
213 std::optional<Kakshya::VertexAccess> access;
214
215 switch (m_topology) {
218 access = Kakshya::as_line_vertex_access(slots);
219 break;
222 access = Kakshya::as_mesh_vertex_access(slots);
223 break;
224 default:
225 access = Kakshya::as_point_vertex_access(slots);
226 break;
227 }
228
229 if (!access) {
231 "DataWriteProcessor: vertex access failed for modality {}",
233 return;
234 }
235
236 ensure_capacity(vk, access->byte_count);
237 upload_to_gpu(access->data_ptr, access->byte_count, vk, m_staging);
238 vk->set_vertex_layout(access->layout);
239}
#define MF_RT_ERROR(comp, ctx,...)
void ensure_capacity(const std::shared_ptr< VKBuffer > &vk, size_t required)
Portal::Graphics::PrimitiveTopology m_topology
void upload_to_gpu(const void *data, size_t size, const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging)
Upload raw data to GPU buffer (auto-detects host-visible vs device-local)
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
std::optional< VertexAccess > as_line_vertex_access(std::span< const DataVariant > channels, const VertexAccessConfig &config)
Assemble line-vertex-compatible bytes from one or more data channels.
std::optional< VertexAccess > as_point_vertex_access(std::span< const DataVariant > channels, const VertexAccessConfig &config)
Assemble point-vertex-compatible bytes from one or more data channels.
std::string_view modality_to_string(DataModality modality)
Convert DataModality enum to string representation.
Definition NDData.cpp:83
std::optional< VertexAccess > as_mesh_vertex_access(std::span< const DataVariant > channels, const VertexAccessConfig &config)
Assemble mesh-vertex-compatible bytes from one or more data channels.

References MayaFlux::Kakshya::as_line_vertex_access(), MayaFlux::Kakshya::as_mesh_vertex_access(), MayaFlux::Kakshya::as_point_vertex_access(), MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, ensure_capacity(), MayaFlux::Portal::Graphics::LINE_LIST, MayaFlux::Portal::Graphics::LINE_STRIP, m_modality, m_staging, m_topology, MF_RT_ERROR, MayaFlux::Kakshya::modality_to_string(), MayaFlux::Portal::Graphics::TRIANGLE_LIST, MayaFlux::Portal::Graphics::TRIANGLE_STRIP, and MayaFlux::Buffers::upload_to_gpu().

Referenced by upload_primary().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: