mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 21:47:47 +00:00
Move EnumClassBitmasks from wgpu to dawn namespace
The EnumClassBitmasks is used by dawn/api_cpp.h that needs to be common. Define a macro to export the operators from dawn to other various namespace. BUG=dawn:1201 Change-Id: I20badd54e844fead6ecf12546a2c9e0afa2fd83f Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/71900 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Junwei Fu <junwei.fu@intel.com>
This commit is contained in:
@@ -17,7 +17,19 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace wgpu {
|
||||
// The operators in dawn:: namespace need be introduced into other namespaces with
|
||||
// using-declarations for C++ Argument Dependent Lookup to work.
|
||||
#define DAWN_IMPORT_BITMASK_OPERATORS \
|
||||
using dawn::operator|; \
|
||||
using dawn::operator&; \
|
||||
using dawn::operator^; \
|
||||
using dawn::operator~; \
|
||||
using dawn::operator&=; \
|
||||
using dawn::operator|=; \
|
||||
using dawn::operator^=; \
|
||||
using dawn::HasZeroOrOneBits;
|
||||
|
||||
namespace dawn {
|
||||
|
||||
template <typename T>
|
||||
struct IsDawnBitmask {
|
||||
@@ -139,6 +151,6 @@ namespace wgpu {
|
||||
return (static_cast<Integral>(value) & (static_cast<Integral>(value) - 1)) == 0;
|
||||
}
|
||||
|
||||
} // namespace wgpu
|
||||
} // namespace dawn
|
||||
|
||||
#endif // DAWN_ENUM_CLASS_BITMASKS_H_
|
||||
|
||||
Reference in New Issue
Block a user