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

◆ swap_field()

void MayaFlux::Buffers::VolumeGridBuffer::swap_field ( const std::string &  name)

Exchange read and write slots for the named field.

Parameters
nameField name. No effect on single-slot fields.

Called by whichever stage last wrote the field, after its dispatch, so the next stage reading it observes the new values. A stage that writes a field it also reads must swap; a stage writing a scratch field consumed immediately after need not.

Definition at line 503 of file VolumeGridBuffer.cpp.

504{
505 auto it = m_fields.find(name);
506 if (it == m_fields.end()) {
508 "VolumeGridBuffer::swap_field: no field named '{}'", name);
509 return;
510 }
511
512 if (it->second.slot_a == it->second.slot_b) {
513 return;
514 }
515
516 it->second.read_is_a = !it->second.read_is_a;
517}
#define MF_ERROR(comp, ctx,...)
std::string name
Definition VKDevice.cpp:123
std::unordered_map< std::string, Field > m_fields
@ BufferManagement
Buffer Management (Buffers::BufferManager, creating buffers)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferManagement, MayaFlux::Journal::Buffers, m_fields, MF_ERROR, and name.