MayaFlux 1.0.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 371 of file GraphicsSubsystem.cpp.

372{
373 while (m_running.load(std::memory_order_acquire)) {
374 if (m_paused.load(std::memory_order_acquire)) {
375 std::this_thread::sleep_for(std::chrono::milliseconds(16));
376 continue;
377 }
378
379 m_frame_clock->tick();
380
381 process();
382
383 m_frame_clock->wait_for_next_frame();
384
385 if (m_frame_clock->is_frame_late()) {
386 uint64_t lag = m_frame_clock->get_frame_lag();
387 if (lag > 2) {
389 "Frame lag detected: {} frames behind (Measured FPS: {:.1f})",
390 lag, m_frame_clock->get_measured_fps());
391 }
392 }
393 }
394}
#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: