mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
Add WGPUAdapterProperties and expose it in DawnNative
The dawn_native::Adapter::GetPCIInfo/GetBackendType/GetDeviceType methods are now deprecated in favor of a method returning a webgpu.h AdapterProperties structure. Deprecated function are still available to avoid breaking Chromium or Skia compilation. This reduces the difference between dawn.json and webgpu.h BUG=dawn:160 Change-Id: Ib68fe1c4d1d87676c01c212c91f80fdd26056c56 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14541 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
5fc2c82c11
commit
f12c9dba6d
@@ -120,7 +120,7 @@ namespace dawn_native {
|
||||
return;
|
||||
}
|
||||
|
||||
auto Register = [this](BackendConnection* connection, BackendType expectedType) {
|
||||
auto Register = [this](BackendConnection* connection, wgpu::BackendType expectedType) {
|
||||
if (connection != nullptr) {
|
||||
ASSERT(connection->GetType() == expectedType);
|
||||
ASSERT(connection->GetInstance() == this);
|
||||
@@ -129,25 +129,25 @@ namespace dawn_native {
|
||||
};
|
||||
|
||||
#if defined(DAWN_ENABLE_BACKEND_D3D12)
|
||||
Register(d3d12::Connect(this), BackendType::D3D12);
|
||||
Register(d3d12::Connect(this), wgpu::BackendType::D3D12);
|
||||
#endif // defined(DAWN_ENABLE_BACKEND_D3D12)
|
||||
#if defined(DAWN_ENABLE_BACKEND_METAL)
|
||||
Register(metal::Connect(this), BackendType::Metal);
|
||||
Register(metal::Connect(this), wgpu::BackendType::Metal);
|
||||
#endif // defined(DAWN_ENABLE_BACKEND_METAL)
|
||||
#if defined(DAWN_ENABLE_BACKEND_VULKAN)
|
||||
Register(vulkan::Connect(this), BackendType::Vulkan);
|
||||
Register(vulkan::Connect(this), wgpu::BackendType::Vulkan);
|
||||
#endif // defined(DAWN_ENABLE_BACKEND_VULKAN)
|
||||
#if defined(DAWN_ENABLE_BACKEND_OPENGL)
|
||||
Register(opengl::Connect(this), BackendType::OpenGL);
|
||||
Register(opengl::Connect(this), wgpu::BackendType::OpenGL);
|
||||
#endif // defined(DAWN_ENABLE_BACKEND_OPENGL)
|
||||
#if defined(DAWN_ENABLE_BACKEND_NULL)
|
||||
Register(null::Connect(this), BackendType::Null);
|
||||
Register(null::Connect(this), wgpu::BackendType::Null);
|
||||
#endif // defined(DAWN_ENABLE_BACKEND_NULL)
|
||||
|
||||
mBackendsConnected = true;
|
||||
}
|
||||
|
||||
ResultOrError<BackendConnection*> InstanceBase::FindBackend(BackendType type) {
|
||||
ResultOrError<BackendConnection*> InstanceBase::FindBackend(wgpu::BackendType type) {
|
||||
for (std::unique_ptr<BackendConnection>& backend : mBackends) {
|
||||
if (backend->GetType() == type) {
|
||||
return backend.get();
|
||||
@@ -161,7 +161,7 @@ namespace dawn_native {
|
||||
EnsureBackendConnections();
|
||||
|
||||
BackendConnection* backend;
|
||||
DAWN_TRY_ASSIGN(backend, FindBackend(options->backendType));
|
||||
DAWN_TRY_ASSIGN(backend, FindBackend(static_cast<wgpu::BackendType>(options->backendType)));
|
||||
|
||||
std::vector<std::unique_ptr<AdapterBase>> newAdapters;
|
||||
DAWN_TRY_ASSIGN(newAdapters, backend->DiscoverAdapters(options));
|
||||
|
||||
Reference in New Issue
Block a user