From: Mikko Rasa Date: Tue, 27 Apr 2021 10:27:11 +0000 (+0300) Subject: Actually update the shdata generation numbers in Renderer X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=acb4aba95c22fa7c72eeef10befd611570d35182;p=libs%2Fgl.git Actually update the shdata generation numbers in Renderer --- diff --git a/source/render/renderer.cpp b/source/render/renderer.cpp index 8e8e215f..dc41eb11 100644 --- a/source/render/renderer.cpp +++ b/source/render/renderer.cpp @@ -398,7 +398,10 @@ void Renderer::apply_state() if(extra_shdata) shdata_stack.erase(shdata_stack.begin()+state->shdata_count, shdata_stack.end()); for(vector::const_iterator i=shdata_stack.begin(); i!=shdata_stack.end(); ++i) + { i->shdata->apply(); + i->generation = i->shdata->get_generation(); + } changed &= ~SHADER_DATA; } diff --git a/source/render/renderer.h b/source/render/renderer.h index 89f11122..1a84d8bf 100644 --- a/source/render/renderer.h +++ b/source/render/renderer.h @@ -78,7 +78,7 @@ private: struct BoundProgramData { const ProgramData *shdata; - unsigned generation; + mutable unsigned generation; BoundProgramData(const ProgramData *); };