]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/renderpass.cpp
Use specialization constants in the builtin material shaders
[libs/gl.git] / source / materials / renderpass.cpp
index 561eab6a7045f9f5448701398737cf370b4c1af6..5ee50f8a1726b39cf986740db7326c699281f2d6 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());
@@ -124,12 +124,12 @@ void RenderPass::set_material(const Material *mat)
        finalize_material(0);
 }
 
-void RenderPass::set_texture(unsigned index, const Texture *tex)
+void RenderPass::set_texture(unsigned index, const Texture *tex, const Sampler *samp)
 {
        if(!texturing)
                texturing = new Texturing;
 
-       texturing->attach(index, *tex, texturing->get_attached_sampler(index));
+       texturing->attach(index, *tex, (samp ? samp : texturing->get_attached_sampler(index)));
 }
 
 int RenderPass::get_texture_index(const string &n) const