- {
- int unit = (t.tag.id ? state->shprog->get_uniform_binding(t.tag) : t.unit);
- if(unit>=0)
- pipeline_state.set_texture(unit, t.texture, t.sampler);
- }
+ if(t.texture && t.replaced<0)
+ {
+ if(t.binding<0 || shprog_changed)
+ t.binding = state->shprog->get_uniform_binding(t.tag);
+ if(t.binding>=0)
+ pipeline_state.set_texture(t.binding, t.texture, t.sampler);
+ }