#include <algorithm>
+#include <msp/core/hash.h>
+#include <msp/strings/format.h>
#include "arb_shader_objects.h"
#include "arb_vertex_shader.h"
#include "error.h"
uniforms[name] = info;
}
}
+
+ string layout_descriptor;
+ for(map<string, UniformInfo>::const_iterator i = uniforms.begin(); i!=uniforms.end(); ++i)
+ if(i->second.location>=0)
+ {
+ if(!layout_descriptor.empty())
+ layout_descriptor += '\n';
+ layout_descriptor += format("%d:%s:%x", i->second.location, i->second.name, i->second.type);
+ }
+ uniform_layout_hash = hash32(layout_descriptor);
}
string Program::get_info_log() const
std::list<Shader *> owned_data;
bool linked;
std::map<std::string, UniformInfo> uniforms;
+ unsigned uniform_layout_hash;
public:
Program();
bool is_linked() const { return linked; }
std::string get_info_log() const;
void bind() const;
+ unsigned get_uniform_layout_hash() const { return uniform_layout_hash; }
int get_uniform_location(const std::string &) const;
static void unbind();