mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +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:
@@ -46,14 +46,6 @@ namespace {{metadata.namespace}} {
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% for type in by_category["bitmask"] %}
|
||||
template<>
|
||||
struct IsDawnBitmask<{{as_cppType(type.name)}}> {
|
||||
static constexpr bool enable = true;
|
||||
};
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% for type in by_category["function pointer"] %}
|
||||
using {{as_cppType(type.name)}} = {{as_cType(type.name)}};
|
||||
{% endfor %}
|
||||
@@ -242,6 +234,20 @@ namespace {{metadata.namespace}} {
|
||||
};
|
||||
|
||||
{% endfor %}
|
||||
|
||||
// The operators of EnumClassBitmmasks in the dawn:: namespace need to be imported
|
||||
// in the {{metadata.namespace}} namespace for Argument Dependent Lookup.
|
||||
DAWN_IMPORT_BITMASK_OPERATORS
|
||||
} // namespace {{metadata.namespace}}
|
||||
|
||||
namespace dawn {
|
||||
{% for type in by_category["bitmask"] %}
|
||||
template<>
|
||||
struct IsDawnBitmask<{{metadata.namespace}}::{{as_cppType(type.name)}}> {
|
||||
static constexpr bool enable = true;
|
||||
};
|
||||
|
||||
{% endfor %}
|
||||
} // namespace dawn
|
||||
|
||||
#endif // {{API}}_CPP_H_
|
||||
|
||||
Reference in New Issue
Block a user