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 void ReflectData::UniformBlockInfo::sort_uniforms()
22 sort(uniforms, [](const UniformInfo *u1, const UniformInfo *u2){ return u1->location<u2->location; });
25 void ReflectData::UniformBlockInfo::update_layout_hash()
27 string layout_descriptor;
28 for(const UniformInfo *u: uniforms)
29 layout_descriptor += format("%d:%s:%x:%d\n", u->location, u->name, u->type, u->array_size);
30 layout_hash = hash32(layout_descriptor);