From e46e286a18aa68818d6405c667e3d92c7b03cf70 Mon Sep 17 00:00:00 2001 From: Arnold <397136899@qq.com> Date: Fri, 15 Mar 2019 17:19:04 +0800 Subject: [PATCH] fix hash function --- cocos/renderer/backend/Types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/renderer/backend/Types.cpp b/cocos/renderer/backend/Types.cpp index a7c4afd68c..61a375f466 100644 --- a/cocos/renderer/backend/Types.cpp +++ b/cocos/renderer/backend/Types.cpp @@ -10,7 +10,7 @@ bool UniformLocation::operator==(const UniformLocation &other) const } std::size_t UniformLocation::operator()(const UniformLocation &uniform) const { - return (size_t)(shaderStage) || (size_t)((location << 4)& 0xFFFFFFF0); + return (((size_t) shaderStage) & 0xFFFFFFF0 )|((size_t)(location << 4)); } CC_BACKEND_END