From 7503b8514cfcc9861c74cfebb0c60db3f72fa29b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 26 Nov 2016 06:52:39 +0200 Subject: [PATCH] Set the appropriate flags on Renderer state changes --- source/renderer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/renderer.cpp b/source/renderer.cpp index 3bef74b3..a0dc4151 100644 --- a/source/renderer.cpp +++ b/source/renderer.cpp @@ -59,6 +59,7 @@ void Renderer::begin(const Camera *c) state->modelview_matrix = MatrixStack::modelview().top(); standard_shdata.uniform("projection_matrix", MatrixStack::projection().top()); } + changed |= MATRIX|STANDARD_SHDATA; } void Renderer::set_matrix(const Matrix &matrix) @@ -113,7 +114,10 @@ void Renderer::set_clipping(const Clipping *c) state->clipping = c; state->clipping_matrix = state->modelview_matrix; if(c) + { c->update_shader_data(standard_shdata, state->clipping_matrix); + changed |= STANDARD_SHDATA; + } changed |= LEGACY_CLIPPING; } @@ -171,13 +175,19 @@ void Renderer::pop_state() if(state->lighting!=old_lighting) { if(state->lighting) + { state->lighting->update_shader_data(standard_shdata, state->lighting_matrix); + changed |= STANDARD_SHDATA; + } changed |= LEGACY_LIGHTING; } if(state->clipping!=old_clipping) { if(state->clipping) + { state->clipping->update_shader_data(standard_shdata, state->clipping_matrix); + changed |= STANDARD_SHDATA; + } changed |= LEGACY_CLIPPING; } } -- 2.45.2