]> git.tdb.fi Git - libs/gl.git/commitdiff
Also re-apply standard shader data when the shader program changes
authorMikko Rasa <tdb@tdb.fi>
Sat, 10 Dec 2016 23:01:31 +0000 (01:01 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 10 Dec 2016 23:01:31 +0000 (01:01 +0200)
source/renderer.cpp

index c744ac5a825009f588c305657f7938daf97b7178..c3a6923f17338cb51d4221f02f6aa158e07fa0fe 100644 (file)
@@ -330,13 +330,13 @@ void Renderer::apply_state()
                                changed = (changed&~MODERN_MATRIX)|STANDARD_SHDATA;
                        }
 
-                       if(state->material && (changed&MATERIAL_SHDATA))
+                       if(state->material && ((changed&MATERIAL_SHDATA) || shprog_changed))
                        {
                                state->material->get_shader_data().apply();
                                changed &= ~MATERIAL_SHDATA;
                        }
 
-                       if(changed&STANDARD_SHDATA)
+                       if((changed&STANDARD_SHDATA) || shprog_changed)
                        {
                                standard_shdata.apply();
                                changed &= ~STANDARD_SHDATA;