]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programdata.cpp
Recreate RenderPass shdata if a new program is specified
[libs/gl.git] / source / programdata.cpp
index e279635f876116d1e40fce3064423e05c1e597c3..3561719725501a4ca7663ad4ae6c3e825e6bd10b 100644 (file)
@@ -34,6 +34,23 @@ ProgramData::ProgramData(const ProgramData &other):
                i->value = i->value->clone();
 }
 
+ProgramData::ProgramData(const ProgramData &other, const Program *p):
+       tied_program(p),
+       last_block(0),
+       buffer(0),
+       dirty(0)
+{
+       if(tied_program)
+       {
+               for(vector<NamedUniform>::const_iterator i=other.uniforms.begin(); i!=other.uniforms.end(); ++i)
+                       tied_program->get_uniform_info(i->name);
+       }
+
+       uniforms = other.uniforms;
+       for(vector<NamedUniform>::iterator i=uniforms.begin(); i!=uniforms.end(); ++i)
+               i->value = i->value->clone();
+}
+
 ProgramData &ProgramData::operator=(const ProgramData &other)
 {
        tied_program = other.tied_program;