]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/renderpass.cpp
Add a collection parameter to RenderPass::set_material
[libs/gl.git] / source / materials / renderpass.cpp
index fb092624b756c06ff463cdb34097b458cdd15158..810b3673e584671423c95795a0eaab5cdd9c5e93 100644 (file)
@@ -77,7 +77,7 @@ void RenderPass::maybe_create_material_shader(DataFile::Collection *coll)
                shprog.keep();
        }
        else
-               shprog = material->create_compatible_shader();
+               throw invalid_operation("no collection");
 
        if(shdata)
                shdata = new ProgramData(*shdata, shprog.get());
@@ -117,11 +117,11 @@ const string &RenderPass::get_slotted_uniform_name(const string &slot) const
        return i->second;
 }
 
-void RenderPass::set_material(const Material *mat)
+void RenderPass::set_material(const Material *mat, DataFile::Collection *coll)
 {
        material = mat;
        material.keep();
-       finalize_material(0);
+       finalize_material(coll);
 }
 
 void RenderPass::set_texture(unsigned index, const Texture *tex, const Sampler *samp)