]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/program.cpp
Move checking of vertex attribute indices to VertexSetup
[libs/gl.git] / source / core / program.cpp
index 9ef5d6d7eebbf4eef2173b0b33abaec28379c37e..7fff5859c1240ca724f8536f1d72e1e59e1511da 100644 (file)
@@ -86,6 +86,11 @@ void Program::add_stages(const Module &mod, const map<string, int> &spec_values)
        compiler.set_source(module->get_prepared_source(), "<module>");
        compiler.specialize(spec_values);
        compiler.compile(SL::Compiler::PROGRAM);
+#ifdef DEBUG
+       string diagnostics = compiler.get_diagnostics();
+       if(!diagnostics.empty())
+               IO::print("Program diagnostics:\n%s\n", diagnostics);
+#endif
 
        vector<SL::Stage::Type> stages = compiler.get_stages();
        for(vector<SL::Stage::Type>::const_iterator i=stages.begin(); i!=stages.end(); ++i)
@@ -166,9 +171,9 @@ void Program::bind_attribute(unsigned index, const string &name)
        glBindAttribLocation(id, index, name.c_str());
 }
 
-void Program::bind_attribute(VertexComponent comp, const string &name)
+void Program::bind_attribute(VertexAttribute attr, const string &name)
 {
-       bind_attribute(get_component_type(comp), name);
+       bind_attribute(get_attribute_semantic(attr), name);
 }
 
 void Program::bind_fragment_data(unsigned index, const string &name)