GPU: Better hash for specialization constants
Due to an error in the hash function the specialization constants hash wasn't optimal. This PR fixes the hash function implementation by replacing the addition with an xor. Pull Request: https://projects.blender.org/blender/blender/pulls/120964
This commit is contained in:
@@ -1233,7 +1233,7 @@ struct DefaultHash<Vector<gpu::shader::ShaderCreateInfo::SpecializationConstant:
|
||||
{
|
||||
uint64_t hash = 0;
|
||||
for (const gpu::shader::ShaderCreateInfo::SpecializationConstant::Value &value : key) {
|
||||
hash = hash * 33 + value.u;
|
||||
hash = hash * 33 ^ uint64_t(value.u);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user