From c0c5eeb27e447df7eee9a98277d88c5cca252180 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 18 Feb 2022 17:23:30 +0100 Subject: [PATCH] display: Don't start/stop collectors for empty window list --- panda/src/display/graphicsEngine.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index bc98317a01..ec047a8ac0 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -2579,10 +2579,18 @@ void GraphicsEngine::WindowRenderer:: do_frame(GraphicsEngine *engine, Thread *current_thread) { LightReMutexHolder holder(_wl_lock); - engine->cull_to_bins(_cull, current_thread); - engine->cull_and_draw_together(_cdraw, current_thread); - engine->draw_bins(_draw, current_thread); - engine->process_events(_window, current_thread); + if (!_cull.empty()) { + engine->cull_to_bins(_cull, current_thread); + } + if (!_cdraw.empty()) { + engine->cull_and_draw_together(_cdraw, current_thread); + } + if (!_draw.empty()) { + engine->draw_bins(_draw, current_thread); + } + if (!_window.empty()) { + engine->process_events(_window, current_thread); + } // If any GSG's on the list have no more outstanding pointers, clean them // up. (We are in the draw thread for all of these GSG's.)