From 2a27f2d40ef2359e347c838887101904789941d2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 13 Aug 2016 18:29:14 +0300 Subject: [PATCH] Binding fixes for Clipping when mixing legacy and modern mode --- source/clipping.cpp | 2 +- source/renderer.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/clipping.cpp b/source/clipping.cpp index e309df58..487eeca6 100644 --- a/source/clipping.cpp +++ b/source/clipping.cpp @@ -59,7 +59,7 @@ void Clipping::bind(bool legacy) const static Require _req(MSP_legacy_features); const Clipping *old = current(); - if(!set_current(this)) + if(!set_current(this) && !(legacy && !bound_with_legacy)) return; bound_with_legacy = legacy; diff --git a/source/renderer.cpp b/source/renderer.cpp index 6a4c488f..cbec16e9 100644 --- a/source/renderer.cpp +++ b/source/renderer.cpp @@ -273,22 +273,22 @@ void Renderer::apply_state() } } - if(changed&CLIPPING) + if(state->clipping) { - if(state->clipping) + if(legacy_bindings) { - if(legacy_bindings) + if(changed&CLIPPING) { MatrixStack::modelview() = state->clipping_matrix; state->clipping->bind(true); changed = (changed&~CLIPPING)|LEGACY_MATRIX; } - else - state->clipping->bind(false); } else - Clipping::unbind(); + state->clipping->bind(false); } + else + Clipping::unbind(); if(state->shprog) { -- 2.45.2