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

◆ execute_frame_phased()

Vruta::GraphicsRoutine MayaFlux::Kriya::BufferPipeline::execute_frame_phased ( uint64_t  max_cycles,
uint64_t  frames_per_operation 
)
private

Definition at line 258 of file BufferPipelineExecution.cpp.

259{
260 auto& promise = co_await Kriya::GetGraphicsPromise {};
261
262 if (m_operations.empty()) {
263 co_return;
264 }
265
267 uint32_t cycles_executed = 0;
268
269 while ((max_cycles == 0 || cycles_executed < max_cycles) && (m_continuous_execution || cycles_executed < max_cycles)) {
270
271 if (promise.should_terminate) {
272 break;
273 }
274
275 bool waited = false;
276
277 start_cycle();
279
280 for (size_t i = 0; i < m_operations.size(); ++i) {
281 auto& op = m_operations[i];
282
284 continue;
285 }
286
287 const uint32_t op_iterations = operation_iterations(op);
288
289 for (uint32_t iter = 0; iter < op_iterations; ++iter) {
291 waited = true;
292 co_await FrameDelay { .frames_to_wait = 1 };
293 }
294
296 }
297
298 for (size_t i = 0; i < m_operations.size(); ++i) {
299 auto& op = m_operations[i];
300
302 continue;
303 }
304
306 continue;
307 }
308
309 if (!operation_due(op)) {
310 continue;
311 }
312
315
316 if (frames_per_operation > 0) {
317 waited = true;
318 co_await FrameDelay { .frames_to_wait = frames_per_operation };
319 }
320 }
321
322 const auto synchronous_tasks = dispatch_cycle_branches(true);
323
324 while (any_active(synchronous_tasks)) {
325 waited = true;
326 co_await FrameDelay { .frames_to_wait = 1 };
327 }
328
329 finish_cycle();
330
332 cycles_executed++;
333
334 if (!waited) {
335 co_await FrameDelay { .frames_to_wait = 1 };
336 }
337 }
338
339 if (m_on_complete)
341}
static bool is_capture_phase_operation(const BufferOperation &op)
static bool is_process_phase_operation(const BufferOperation &op)
@ READY
Data ready for processing.
uint32_t operation_iterations(const BufferOperation &op) const
void process_operation(BufferOperation &op, uint64_t cycle)
std::vector< BufferOperation > m_operations
std::vector< DataState > m_data_states
static bool any_active(const std::vector< std::shared_ptr< Vruta::Routine > > &tasks)
std::function< void()> m_on_complete
bool operation_due(const BufferOperation &op) const
std::vector< std::shared_ptr< Vruta::Routine > > dispatch_cycle_branches(bool frame_rate)
GetPromiseBase< Vruta::graphics_promise > GetGraphicsPromise
Graphics domain promise accessor.

References any_active(), CONSUMED, dispatch_cycle_branches(), EMPTY, finish_cycle(), MayaFlux::Kriya::FrameDelay::frames_to_wait, MayaFlux::Kriya::BufferOperation::is_capture_phase_operation(), MayaFlux::Kriya::BufferOperation::is_process_phase_operation(), m_continuous_execution, m_current_cycle, m_data_states, m_on_complete, m_operations, operation_due(), operation_iterations(), process_operation(), READY, reset_cycle_state(), and start_cycle().

Referenced by execute_frame_internal().

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