Skip to content

Commit

Permalink
RenderPass now considers clearColor
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e committed Aug 12, 2024
1 parent a039349 commit f2a335d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions native/cocos/renderer/gfx-base/GFXDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@ bool operator==(const BufferBarrierInfo &lhs, const BufferBarrierInfo &rhs) {
return !memcmp(&lhs, &rhs, sizeof(BufferBarrierInfo));
}

template <>
ccstd::hash_t Hasher<Color>::operator()(const Color &info) const {
ccstd::hash_t seed = 0;
ccstd::hash_combine(seed, info.x);
ccstd::hash_combine(seed, info.y);
ccstd::hash_combine(seed, info.z);
ccstd::hash_combine(seed, info.w);
return seed;
}

///////////////////////////////////////////////////////////////////////////////

bool operator==(const Viewport &lhs, const Viewport &rhs) {
Expand Down
5 changes: 3 additions & 2 deletions native/cocos/renderer/pipeline/custom/RenderGraphTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ struct RasterView {
};

inline bool operator==(const RasterView& lhs, const RasterView& rhs) noexcept {
return std::forward_as_tuple(lhs.slotName, lhs.slotName1, lhs.accessType, lhs.attachmentType, lhs.loadOp, lhs.storeOp, lhs.clearFlags, lhs.shaderStageFlags) ==
std::forward_as_tuple(rhs.slotName, rhs.slotName1, rhs.accessType, rhs.attachmentType, rhs.loadOp, rhs.storeOp, rhs.clearFlags, rhs.shaderStageFlags);
return std::forward_as_tuple(lhs.slotName, lhs.slotName1, lhs.accessType, lhs.attachmentType, lhs.loadOp, lhs.storeOp, lhs.clearFlags, lhs.clearColor, lhs.shaderStageFlags) ==
std::forward_as_tuple(rhs.slotName, rhs.slotName1, rhs.accessType, rhs.attachmentType, rhs.loadOp, rhs.storeOp, rhs.clearFlags, rhs.clearColor, rhs.shaderStageFlags);
}

inline bool operator!=(const RasterView& lhs, const RasterView& rhs) noexcept {
Expand Down Expand Up @@ -1219,6 +1219,7 @@ inline hash_t hash<cc::render::RasterView>::operator()(const cc::render::RasterV
hash_combine(seed, val.loadOp);
hash_combine(seed, val.storeOp);
hash_combine(seed, val.clearFlags);
hash_combine(seed, val.clearColor);
hash_combine(seed, val.shaderStageFlags);
return seed;
}
Expand Down

0 comments on commit f2a335d

Please sign in to comment.