1 #include <msp/core/algorithm.h>
2 #include <msp/core/hash.h>
3 #include <msp/strings/format.h>
4 #include "reflectdata.h"
11 void ReflectData::update_layout_hash()
13 string layout_descriptor;
14 for(const UniformBlockInfo &b: uniform_blocks)
15 layout_descriptor += format("%d:%x\n", b.bind_point, b.layout_hash);
16 layout_hash = hash32(layout_descriptor);
20 ReflectData::UniformInfo::UniformInfo():
31 ReflectData::UniformBlockInfo::UniformBlockInfo():
37 void ReflectData::UniformBlockInfo::sort_uniforms()
39 sort(uniforms, [](const UniformInfo *u1, const UniformInfo *u2){ return u1->location<u2->location; });
42 void ReflectData::UniformBlockInfo::update_layout_hash()
44 string layout_descriptor;
45 for(const UniformInfo *u: uniforms)
46 layout_descriptor += format("%d:%s:%x:%d\n", u->location, u->name, u->type, u->array_size);
47 layout_hash = hash32(layout_descriptor);
51 ReflectData::AttributeInfo::AttributeInfo():