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

◆ graphics_thread_loop()

void MayaFlux::Core::GraphicsSubsystem::graphics_thread_loop ( )
private

Graphics thread main loop.

Self-driven frame processing:

  1. Tick frame clock (advances based on wall-clock time)
  2. Process visual nodes (VISUAL_RATE nodes)
  3. Process graphics buffers (GRAPHICS_BACKEND buffers)
  4. Tick scheduler coroutines (FRAME_ACCURATE tasks)
  5. Record/submit Vulkan commands or OpenGL draw calls
  6. Wait for next frame (vsync timing)

Definition at line 360 of file GraphicsSubsystem.cpp.

361{
362 while (m_running.load(std::memory_order_acquire)) {
363 if (m_paused.load(std::memory_order_acquire)) {
364 std::this_thread::sleep_for(std::chrono::milliseconds(16));
365 continue;
366 }
367
368 m_frame_clock->tick();
369
370 process();
371
372 m_frame_clock->wait_for_next_frame();
373
374 if (m_frame_clock->is_frame_late()) {
375 uint64_t lag = m_frame_clock->get_frame_lag();
376 if (lag > 2) {
378 "Frame lag detected: {} frames behind (Measured FPS: {:.1f})",
379 lag, m_frame_clock->get_measured_fps());
380 }
381 }
382 }
383}
#define MF_RT_WARN(comp, ctx,...)
std::shared_ptr< Vruta::FrameClock > m_frame_clock
void process()
Unified processing callback (alternative to separate methods)
@ GraphicsSubsystem
Graphics subsystem operations (Vulkan, rendering pipeline)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, MayaFlux::Journal::GraphicsSubsystem, m_frame_clock, m_paused, m_running, MF_RT_WARN, and process().

Referenced by start().

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