Commit 126d9d60 by Antonio Maiorano

Fix ComputeProgramKey not strict weak ordering

Example: ComputeProgramKey a, b; a.shader = 1; b.shader = 2; a.layout = 2; b.layout = 1; // This assertion will fail because a < b since a.shader < b.shader, // but also b < a because b.layout < a.layout. assert( (a < b) && !(b < a) ); Change-Id: I1061f517cee60a28a1f4239704655e9d320ade46 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36348 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent e9b6f28f
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
bool operator<(const ComputeProgramKey &other) const bool operator<(const ComputeProgramKey &other) const
{ {
return (shader < other.shader) || (layout < other.layout); return std::tie(shader, layout) < std::tie(other.shader, other.layout);
} }
const sw::SpirvShader* getShader() const { return shader; } const sw::SpirvShader* getShader() const { return shader; }
......
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