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 layout_hash = hash<32>(uniform_blocks.size());
14 for(const UniformBlockInfo &b: uniform_blocks)
16 layout_hash = hash_update<32>(layout_hash, b.bind_point);
17 layout_hash = hash_update<32>(layout_hash, b.layout_hash);
22 void ReflectData::UniformBlockInfo::sort_uniforms()
24 sort(uniforms, [](const UniformInfo *u1, const UniformInfo *u2){ return u1->location<u2->location; });
27 void ReflectData::UniformBlockInfo::update_layout_hash()
29 layout_hash = hash<32>(uniforms.size());
30 for(const UniformInfo *u: uniforms)
32 layout_hash = hash_update<32>(layout_hash, u->location);
33 layout_hash = hash_update<32>(layout_hash, u->name);
34 layout_hash = hash_update<32>(layout_hash, u->type);
35 layout_hash = hash_update<32>(layout_hash, u->array_size);