mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
Combine hash with validator/agent (#10753)
While the texture is destroyed, the old validator is destroyed and new validator inited. But framebuffer validator maintains the old one as hash is the same, so when it start the validation check, the old texture validator jumped out and assertion failed.
This commit is contained in:
@@ -113,12 +113,14 @@ bool operator==(const RenderPassInfo& lhs, const RenderPassInfo& rhs) {
|
||||
template <>
|
||||
size_t Hasher<FramebufferInfo>::operator()(const FramebufferInfo& info) const {
|
||||
// render pass is mostly irrelevant
|
||||
size_t seed = (info.colorTextures.size() + 1) * 2;
|
||||
size_t seed = (info.colorTextures.size() + 1) * 3;
|
||||
for (auto* colorTexture : info.colorTextures) {
|
||||
boost::hash_combine(seed, colorTexture);
|
||||
boost::hash_combine(seed, colorTexture->getRaw());
|
||||
boost::hash_combine(seed, colorTexture->getHash());
|
||||
}
|
||||
|
||||
boost::hash_combine(seed, info.depthStencilTexture);
|
||||
boost::hash_combine(seed, info.depthStencilTexture->getRaw());
|
||||
boost::hash_combine(seed, info.depthStencilTexture->getHash());
|
||||
return seed;
|
||||
|
||||
Reference in New Issue
Block a user