Commit 0597afff by Alexis Hetu Committed by Alexis Hétu

Strict weak ordering for SamplingRoutineCache::Key

Implemented operator< with std::tie to force strict weak ordering. Bug b/141863676 Change-Id: If14328922f0c8c62fd92d74f1bcca0c9a2e77f4c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36929 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 4bbb9841
...@@ -122,7 +122,7 @@ inline bool vk::Device::SamplingRoutineCache::Key::operator == (const Key& rhs) ...@@ -122,7 +122,7 @@ inline bool vk::Device::SamplingRoutineCache::Key::operator == (const Key& rhs)
inline bool vk::Device::SamplingRoutineCache::Key::operator < (const Key& rhs) const inline bool vk::Device::SamplingRoutineCache::Key::operator < (const Key& rhs) const
{ {
return instruction < rhs.instruction || sampler < rhs.sampler || imageView < rhs.imageView; return std::tie(instruction, sampler, imageView) < std::tie(rhs.instruction, rhs.sampler, rhs.imageView);
} }
inline std::size_t vk::Device::SamplingRoutineCache::Key::Hash::operator() (const Key& key) const noexcept inline std::size_t vk::Device::SamplingRoutineCache::Key::Hash::operator() (const Key& key) const noexcept
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment