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

◆ download_compute_mesh()

MAYAFLUX_API std::optional< Kakshya::MeshData > MayaFlux::IO::download_compute_mesh ( const std::shared_ptr< Buffers::ComputeMeshBuffer > &  buffer)

Download a ComputeMeshBuffer's current live geometry to CPU.

ComputeMeshBuffer's own doc states its live rendering path never reads back vertex data; this is the deliberate, one-shot exception for export. Reads the true live vertex count off the atomic counter buffer's mapped pointer (host-visible, no transfer), then downloads exactly that many vertices from the buffer itself, not its worst-case allocated capacity. The result is non-indexed triangles, so a trivial sequential index array (0..N-1) is synthesized to satisfy Kakshya::MeshData's index requirement.

Parameters
bufferSource buffer. setup_processors() must have run.
Returns
The current geometry, or nullopt if the buffer is null, has no mesh processor yet, or the live vertex count is zero.

Definition at line 279 of file ModelExport.cpp.

281{
282 return Buffers::download_compute_mesh(buffer);
283}
std::shared_ptr< NetworkGeometryBuffer > buffer

References buffer, and MayaFlux::Buffers::download_compute_mesh().

Referenced by save_mesh().

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