Use TypedInteger for BindGroupIndex

Bug: dawn:442
Change-Id: I889a943cbaf2d349c31a15fdf126d66964bdd0a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23247
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Austin Eng
2020-06-20 01:30:32 +00:00
committed by Commit Bot service account
parent e5d94c31a0
commit 250f26229b
33 changed files with 218 additions and 149 deletions

View File

@@ -17,6 +17,7 @@
#include "common/Platform.h"
#include "common/TypedInteger.h"
#include "common/ityp_bitset.h"
#include <bitset>
#include <functional>
@@ -87,4 +88,14 @@ size_t Hash(const std::bitset<N>& value) {
}
#endif
namespace std {
template <typename Index, size_t N>
class hash<ityp::bitset<Index, N>> {
public:
size_t operator()(const ityp::bitset<Index, N>& value) const {
return Hash(static_cast<const std::bitset<N>&>(value));
}
};
} // namespace std
#endif // COMMON_HASHUTILS_H_