mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 05:27:49 +00:00
Don't connect to backends that aren't needed
Change backend connection in Instance.cpp to store a bitset of backends that have been connected. This lets us only connect to a single backend if AdapterDiscoveryOptions are passed explicitly, and track which connections have/have not been made. Later, we can connect to the rest of the backends if more are requested. This is part of some improvements to the existing code so we can selectively discover adapters and control discovery of the high-performance, low-power, and fallback WebGPU adapters. Bug: chromium:1266550 Change-Id: Iceb0d3f71751f5aac6218996ace3cf89deda8a29 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/69521 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
@@ -59,6 +59,16 @@ namespace dawn_native {
|
||||
return reinterpret_cast<{{as_cppType(type.name)}}Base*>(rhs);
|
||||
}
|
||||
{% endfor %}
|
||||
|
||||
template <typename T>
|
||||
struct EnumCount;
|
||||
|
||||
{% for e in by_category["enum"] if e.contiguousFromZero %}
|
||||
template<>
|
||||
struct EnumCount<wgpu::{{as_cppType(e.name)}}> {
|
||||
static constexpr uint32_t value = {{len(e.values)}};
|
||||
};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
#endif // DAWNNATIVE_DAWN_PLATFORM_AUTOGEN_H_
|
||||
Reference in New Issue
Block a user