diff options
author | ReinUsesLisp <[email protected]> | 2019-09-09 16:46:46 -0300 |
---|---|---|
committer | ReinUsesLisp <[email protected]> | 2019-09-09 16:46:46 -0300 |
commit | bb6a3421d27b19d8caa203cca96f47210a670070 (patch) | |
tree | bba687f20549211f65f52e17fc25fbf841c07e4d /include | |
parent | ae7c664016471c08ba8fec252e0cab75db817286 (diff) | |
download | sirit-bb6a3421d27b19d8caa203cca96f47210a670070.tar.gz sirit-bb6a3421d27b19d8caa203cca96f47210a670070.zip |
Fix declarations hashing
Diffstat (limited to 'include')
-rw-r--r-- | include/sirit/sirit.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h index 1a0def9..71f8699 100644 --- a/include/sirit/sirit.h +++ b/include/sirit/sirit.h @@ -920,6 +920,15 @@ public: Id OpImageQuerySamples(Id result_type, Id image); private: + struct HashOp { + std::size_t operator()(const std::unique_ptr<Op>& op) const noexcept; + }; + + struct EqualOp { + bool operator()(const std::unique_ptr<Op>& lhs, const std::unique_ptr<Op>& rhs) const + noexcept; + }; + Id AddCode(std::unique_ptr<Op> op); Id AddCode(spv::Op opcode, std::optional<std::uint32_t> id = {}); @@ -945,7 +954,7 @@ private: std::vector<std::unique_ptr<Op>> execution_modes; std::vector<std::unique_ptr<Op>> debug; std::vector<std::unique_ptr<Op>> annotations; - std::unordered_set<std::unique_ptr<Op>> declarations; + std::unordered_set<std::unique_ptr<Op>, HashOp, EqualOp> declarations; std::vector<Id> sorted_declarations; std::vector<Id> global_variables; |