Fix MSVC compilation.

- Fix a struct vs. class in forward declaration of std::hash
 - Fix an unsigned vs. signed compare in BitSetIterator
 - Fix the assumption that std::array::[const_]iterator is a pointer.
 - Fix for reinterpret_cast from uint64_t to uint64_t not being allowed
   for vulkan_platform.h
 - Fix for a 32bit shift being expanded to 64bit.

Bug: None
Change-Id: I5f2bf8745aa1ef1eba9916fcf6ff7801b48f61cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24501
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Corentin Wallez
2020-07-08 18:50:30 +00:00
committed by Commit Bot service account
parent a9c7d64aad
commit 519edd5890
8 changed files with 20 additions and 14 deletions

View File

@@ -37,8 +37,18 @@
#if defined(DAWN_PLATFORM_64_BIT)
# define DAWN_DEFINE_NATIVE_NON_DISPATCHABLE_HANDLE(object) using object = struct object##_T*;
// This function is needed because MSVC doesn't accept reinterpret_cast from uint64_t from uint64_t
// TODO(cwallez@chromium.org): Remove this once we rework vulkan_platform.h
template <typename T>
T NativeNonDispatachableHandleFromU64(uint64_t u64) {
return reinterpret_cast<T>(u64);
}
#elif defined(DAWN_PLATFORM_32_BIT)
# define DAWN_DEFINE_NATIVE_NON_DISPATCHABLE_HANDLE(object) using object = uint64_t;
template <typename T>
T NativeNonDispatachableHandleFromU64(uint64_t u64) {
return u64;
}
#else
# error "Unsupported platform"
#endif