MayaFlux 0.1.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 346 of file GraphicsSubsystem.cpp.

347{
348 while (m_running.load(std::memory_order_acquire)) {
349 if (m_paused.load(std::memory_order_acquire)) {
350 std::this_thread::sleep_for(std::chrono::milliseconds(16));
351 continue;
352 }
353
354 m_frame_clock->tick();
355
356 process();
357
358 m_frame_clock->wait_for_next_frame();
359
360 if (m_frame_clock->is_frame_late()) {
361 uint64_t lag = m_frame_clock->get_frame_lag();
362 if (lag > 2) {
364 "Frame lag detected: {} frames behind (Measured FPS: {:.1f})",
365 lag, m_frame_clock->get_measured_fps());
366 }
367 }
368 }
369}
#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: