MayaFlux 0.2.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 356 of file GraphicsSubsystem.cpp.

357{
358 while (m_running.load(std::memory_order_acquire)) {
359 if (m_paused.load(std::memory_order_acquire)) {
360 std::this_thread::sleep_for(std::chrono::milliseconds(16));
361 continue;
362 }
363
364 m_frame_clock->tick();
365
366 process();
367
368 m_frame_clock->wait_for_next_frame();
369
370 if (m_frame_clock->is_frame_late()) {
371 uint64_t lag = m_frame_clock->get_frame_lag();
372 if (lag > 2) {
374 "Frame lag detected: {} frames behind (Measured FPS: {:.1f})",
375 lag, m_frame_clock->get_measured_fps());
376 }
377 }
378 }
379}
#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: