X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Freflectdata.cpp;fp=source%2Fcore%2Freflectdata.cpp;h=8ecb9abe08fe11eac8e7fd845ebc9dc0fabaf9df;hb=cb4158902a680c58c5834da8577cd95ff753fd7c;hp=db6798730cd4c9c9097e86735beeabed8e8114c3;hpb=afb2687f23ac6c7d078bbad3db4379a2c051416a;p=libs%2Fgl.git diff --git a/source/core/reflectdata.cpp b/source/core/reflectdata.cpp index db679873..8ecb9abe 100644 --- a/source/core/reflectdata.cpp +++ b/source/core/reflectdata.cpp @@ -10,10 +10,12 @@ namespace GL { void ReflectData::update_layout_hash() { - string layout_descriptor; + layout_hash = hash<32>(uniform_blocks.size()); for(const UniformBlockInfo &b: uniform_blocks) - layout_descriptor += format("%d:%x\n", b.bind_point, b.layout_hash); - layout_hash = hash32(layout_descriptor); + { + layout_hash = hash_update<32>(layout_hash, b.bind_point); + layout_hash = hash_update<32>(layout_hash, b.layout_hash); + } } @@ -24,10 +26,14 @@ void ReflectData::UniformBlockInfo::sort_uniforms() void ReflectData::UniformBlockInfo::update_layout_hash() { - string layout_descriptor; + layout_hash = hash<32>(uniforms.size()); for(const UniformInfo *u: uniforms) - layout_descriptor += format("%d:%s:%x:%d\n", u->location, u->name, u->type, u->array_size); - layout_hash = hash32(layout_descriptor); + { + layout_hash = hash_update<32>(layout_hash, u->location); + layout_hash = hash_update<32>(layout_hash, u->name); + layout_hash = hash_update<32>(layout_hash, u->type); + layout_hash = hash_update<32>(layout_hash, u->array_size); + } } } // namespace GL