mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
Add end2end test for all vertex formats
BUG=dawn:41 Change-Id: I37bde37843522a8d7c8b3bea1cb24c0971efd8e2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6340 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
This commit is contained in:
committed by
Commit Bot service account
parent
a32e3bd014
commit
9286adcb0f
@@ -17,6 +17,10 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
|
||||
// The following are not valid for 0
|
||||
uint32_t ScanForward(uint32_t bits);
|
||||
@@ -38,4 +42,14 @@ const T* AlignPtr(const T* ptr, size_t alignment) {
|
||||
return reinterpret_cast<const T*>(AlignVoidPtr(const_cast<T*>(ptr), alignment));
|
||||
}
|
||||
|
||||
template <typename destType, typename sourceType>
|
||||
destType BitCast(const sourceType& source) {
|
||||
static_assert(sizeof(destType) == sizeof(sourceType), "BitCast: cannot lose precision.");
|
||||
destType output;
|
||||
std::memcpy(&output, &source, sizeof(destType));
|
||||
return output;
|
||||
}
|
||||
|
||||
uint16_t Float32ToFloat16(float fp32);
|
||||
|
||||
#endif // COMMON_MATH_H_
|
||||
|
||||
Reference in New Issue
Block a user