+void PipelineCacheQueryInfo::GenerateHash()
+{
+ // Lightweight hash value generation.
+ hash = (reinterpret_cast<std::size_t>(program) >> Dali::Log<sizeof(decltype(*program))>::value) ^
+ (reinterpret_cast<std::size_t>(geometry) >> Dali::Log<sizeof(decltype(*geometry))>::value) ^
+ ((blendingEnabled ? 1u : 0u) << 0u) ^
+ ((alphaPremultiplied ? 1u : 0u) << 1u) ^
+ (static_cast<std::size_t>(geometry->GetTopology()) << 2u) ^
+ (static_cast<std::size_t>(renderer->GetFaceCullMode()) << 5u) ^
+ ((cameraUsingReflection ? 1u : 0u) << 8u) ^
+ (blendingEnabled ? static_cast<std::size_t>(blendingOptions->GetBitmask()) : 0xDA11u);
+}
+
+bool PipelineCacheQueryInfo::Equal(const PipelineCacheQueryInfo& lhs, const PipelineCacheQueryInfo& rhs) noexcept
+{
+ // Naive equal check.
+ const bool ret = (lhs.hash == rhs.hash) && // Check hash value first
+ (lhs.program == rhs.program) &&
+ (lhs.geometry == rhs.geometry) &&
+ (lhs.blendingEnabled == rhs.blendingEnabled) &&
+ (lhs.alphaPremultiplied == rhs.alphaPremultiplied) &&
+ (lhs.geometry->GetTopology() == rhs.geometry->GetTopology()) &&
+ (lhs.renderer->GetFaceCullMode() == rhs.renderer->GetFaceCullMode()) &&
+ (lhs.cameraUsingReflection == rhs.cameraUsingReflection) &&
+ (!lhs.blendingEnabled ||
+ (lhs.blendingOptions->GetBitmask() == rhs.blendingOptions->GetBitmask() &&
+ ((lhs.blendingOptions->GetBlendColor() == nullptr && rhs.blendingOptions->GetBlendColor() == nullptr) ||
+ (lhs.blendingOptions->GetBlendColor() &&
+ rhs.blendingOptions->GetBlendColor() &&
+ (*lhs.blendingOptions->GetBlendColor() == *rhs.blendingOptions->GetBlendColor())))));
+
+ return ret;
+}
+