201{
202 const auto& collection = layer.collection;
203 const uint64_t head = collection->get_write_head();
204 if (head == 0) {
205 return;
206 }
207
208 const double rate = layer.collection_rate > 0.0 ? layer.collection_rate : state.frame_rate;
209 place(state, layer, head,
rate, 1.0, elapsed);
210
211 const auto frame = static_cast<uint64_t>(std::max(std::floor(layer.position), 0.0));
212 const uint64_t ring = collection->get_spec().ring_layers;
213 if (frame >= head || (ring > 0 && frame + ring < head)) {
214 if (!layer.missed) {
216 "Chimera layer {} is outside the collection, holding its last frame",
index);
217 layer.missed = true;
218 }
219 return;
220 }
221 layer.missed = false;
222
223 const auto slot = static_cast<uint32_t>(ring > 0 ? frame % ring : frame);
224 if (state.buffer->submit_layer(
index, collection->to_image(slot))) {
226 glm::vec4(static_cast<float>(elapsed), static_cast<float>(static_cast<double>(head) - layer.position),
227 static_cast<float>(layer.position), 1.0F));
228 }
229}
#define MF_WARN(comp, ctx,...)
static void stamp(State &state, uint32_t index, const glm::vec4 &timing)
static void place(const State &state, Layer &layer, uint64_t head, double rate, double nearest, double elapsed)
@ CoroutineScheduling
Coroutine scheduling and temporal coordination (Vruta::TaskScheduler)
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.