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

◆ sync()

template<typename T >
void MayaFlux::Portal::Forma::Mapped< T >::sync ( )
inline

Call once per graphics tick.

If state->version has advanced since last_version, invokes geometry_fn with the current value into a local byte buffer, then passes the result to VKBuffer::set_data so the existing upload path handles GPU transfer.

The caller is responsible for driving the graphics tick — Mapped does not register itself with any scheduler.

Definition at line 119 of file Mapped.hpp.

120 {
121 if (!state || !geometry_fn || !element.buffer)
122 return;
123 if (state->version == last_version && !force_redraw_on_sync)
124 return;
125
127 element.buffer->submit(m_bytes);
128 last_version = state->version;
129 }
std::shared_ptr< Buffers::FormaBuffer > buffer
Buffer whose rendered output occupies this region.
Definition Element.hpp:72
std::shared_ptr< MappedState< T > > state
Shared value carrier. External systems hold a copy of this ptr.
Definition Mapped.hpp:91
std::vector< uint8_t > m_bytes
Definition Mapped.hpp:132
GeometryFn< T > geometry_fn
Geometry regeneration function. Set once at construction.
Definition Mapped.hpp:94
Element element
The Element registered with the Layer.
Definition Mapped.hpp:98
bool force_redraw_on_sync
When true, sync() regenerates geometry every call regardless of whether state->version has advanced.
Definition Mapped.hpp:107
Version last_version
Last version seen by sync().
Definition Mapped.hpp:102

References MayaFlux::Portal::Forma::Element::buffer, MayaFlux::Portal::Forma::Mapped< T >::element, MayaFlux::Portal::Forma::Mapped< T >::force_redraw_on_sync, MayaFlux::Portal::Forma::Mapped< T >::geometry_fn, MayaFlux::Portal::Forma::Mapped< T >::last_version, MayaFlux::Portal::Forma::Mapped< T >::m_bytes, and MayaFlux::Portal::Forma::Mapped< T >::state.

Referenced by MayaFlux::Portal::Forma::Collapsible::place().

+ Here is the caller graph for this function: