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

◆ add_slice()

FormaBuffer::SliceId MayaFlux::Buffers::FormaBuffer::add_slice ( const std::vector< uint8_t > &  bytes,
std::optional< Portal::Graphics::PrimitiveTopology >  topology = std::nullopt 
)

Add a block of vertices that shares this buffer with the others.

submit() writes a default block of its own, so a buffer used only through submit() holds one. Blocks share the buffer's topology and are uploaded together; each can be updated, hidden or reordered without touching the rest. Several blocks cost one draw when they are adjacent, visible and in order.

Valid once setup_processors() has run.

Parameters
bytesWhole interleaved vertices matching the topology; a trailing partial vertex is dropped.
topologyTopology of this block; the buffer's when omitted. A different topology needs setup_rendering with triangulate, which draws mixed blocks as one batch.
Returns
Id of the block, or 0 when the buffer has no processor yet.

Definition at line 178 of file FormaBuffer.cpp.

181{
182 if (!m_processor) {
184 "FormaBuffer::add_slice called before setup_processors");
185 return 0;
186 }
187 return m_processor->add_slice(bytes, topology);
188}
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< Buffers::FormaProcessor > m_processor
Portal::Graphics::PrimitiveTopology topology() const
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, m_processor, MF_ERROR, and topology().

Referenced by MayaFlux::Portal::Forma::FormaTarget::slice_of().

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