[Bf-blender-cvs] [6905633e57e] functions: fix generating operation hash
Jacques Lucke
noreply at git.blender.org
Sun Feb 2 14:27:26 CET 2020
Commit: 6905633e57e4dbe976a7ee12b6ceb2c06dbf8f9d
Author: Jacques Lucke
Date: Sun Feb 2 14:17:39 2020 +0100
Branches: functions
https://developer.blender.org/rB6905633e57e4dbe976a7ee12b6ceb2c06dbf8f9d
fix generating operation hash
this needs some more work
===================================================================
M source/blender/functions/intern/multi_functions/constants.cc
M source/blender/functions/intern/multi_functions/constants.h
===================================================================
diff --git a/source/blender/functions/intern/multi_functions/constants.cc b/source/blender/functions/intern/multi_functions/constants.cc
index 995738f879c..051ac8ad7ec 100644
--- a/source/blender/functions/intern/multi_functions/constants.cc
+++ b/source/blender/functions/intern/multi_functions/constants.cc
@@ -35,7 +35,7 @@ MF_GenericConstantValue::MF_GenericConstantValue(const CPPType &type, const void
signature.single_output(ss.str(), type);
if (type == CPP_TYPE<float>()) {
- uint32_t hash = *(uint32_t *)value;
+ uint32_t hash = BLI_hash_int_2d(*(uint *)value, 0);
signature.operation_hash(hash);
}
}
diff --git a/source/blender/functions/intern/multi_functions/constants.h b/source/blender/functions/intern/multi_functions/constants.h
index 754828ea29a..c537a52772b 100644
--- a/source/blender/functions/intern/multi_functions/constants.h
+++ b/source/blender/functions/intern/multi_functions/constants.h
@@ -49,11 +49,11 @@ template<typename T> class MF_ConstantValue : public MultiFunction {
signature.single_output<T>(ss.str());
if (CPP_TYPE<T>() == CPP_TYPE<float>()) {
- uint32_t hash = BLI_hash_int(*(uint *)&m_value);
+ uint32_t hash = BLI_hash_int_2d(*(uint *)&m_value, 0);
signature.operation_hash(hash);
}
else if (CPP_TYPE<T>() == CPP_TYPE<int>()) {
- uint32_t hash = BLI_hash_int(*(uint *)&m_value);
+ uint32_t hash = BLI_hash_int_2d(*(uint *)&m_value, 1);
signature.operation_hash(hash);
}
else if (CPP_TYPE<T>() == CPP_TYPE<std::string>()) {
More information about the Bf-blender-cvs
mailing list