It may be beneficial to revert to a Technique's default value and its
associated buffers instead of explicitly setting the same value in an
ObjectInstance's private ProgramData.
uniform(name, new UniformArray<UniformMatrix4x4f>(n, v));
}
+void ProgramData::remove_uniform(const string &name)
+{
+ SlotMap::iterator i = uniform_slots.find(name);
+ if(i!=uniform_slots.end())
+ {
+ vector<Uniform *>::iterator j = uniforms.begin()+i->second;
+ delete *j;
+ uniforms.erase(j);
+
+ for(SlotMap::iterator k=uniform_slots.begin(); k!=uniform_slots.end(); ++k)
+ if(k->second>i->second)
+ --k->second;
+
+ uniform_slots.erase(i);
+
+ dirty = ALL_ONES;
+ }
+}
+
unsigned ProgramData::compute_slot_mask(const Program::UniformBlockInfo &block) const
{
unsigned mask = 0;
void uniform4_array(const std::string &, unsigned, const int *);
void uniform4_array(const std::string &, unsigned, const float *);
void uniform_matrix4_array(const std::string &, unsigned, const float *);
+ void remove_uniform(const std::string &);
private:
unsigned compute_slot_mask(const Program::UniformBlockInfo &) const;