From de9ed9ee3e8dfab13a35c2450c9d6680689b5568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Fri, 4 Jun 2021 12:31:04 +0200 Subject: [PATCH] Follow-up of 39fd8065a1dd0cc94b7396044392df6476592652: Apply changes also for MMU painting gizmo, so shader->start_using() is called only once. --- src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp index 3cf466dc3..ad726c110 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp @@ -462,16 +462,10 @@ void TriangleSelectorMmuGui::render(ImGuiWrapper *imgui) render_colors[color_idx] = m_iva_colors[color_idx].has_VBOs(); bool render_seed_fill = m_iva_seed_fill.has_VBOs(); - auto *shader = wxGetApp().get_shader("gouraud"); - if (!shader) return; - - shader->start_using(); - ScopeGuard guard([shader]() { - if (shader) - shader->stop_using(); - }); - shader->set_uniform("slope.actived", false); - shader->set_uniform("print_box.actived", false); + auto* shader = wxGetApp().get_current_shader(); + if (! shader) + return; + assert(shader->get_name() == "gouraud"); for (size_t color_idx = 0; color_idx < m_iva_colors.size(); ++color_idx) { if (render_colors[color_idx]) {