From f6796f36b232403c092ffbdf1609f2288d30929c Mon Sep 17 00:00:00 2001 From: Haroon Qureshi Date: Thu, 29 Jan 2026 02:53:56 -0800 Subject: [PATCH] Only update GuiView::UpdateRenderable (which calls imGui::EndFrame internally) when we want to render the GUI to the same target as the scene. PiperOrigin-RevId: 862647358 Change-Id: If3656032b74a168b804dfa34ef3eb97c9817c2c0 --- src/experimental/filament/filament/filament_context.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/experimental/filament/filament/filament_context.cc b/src/experimental/filament/filament/filament_context.cc index 5425b4bc..e02defb9 100644 --- a/src/experimental/filament/filament/filament_context.cc +++ b/src/experimental/filament/filament/filament_context.cc @@ -144,7 +144,7 @@ void FilamentContext::Render(const mjrRect& viewport, const mjvScene* scene, scene_view_->UpdateScene(con, scene); // Update the UX renderable entity after processing the scene in case there // are any elements in the scene which generate UX draw calls (e.g. labels). - if (gui_view_) { + if (gui_view_ && gui_swap_chain_target_ == scene_swap_chain_target_) { // Prepare the filament Renderable that contains the GUI draw commands. We // must call this function even if we do not plan on rendering the GUI to // ensure the ImGui state is updated.