From 03b3594f79a2fb322dad39b757dbe706b905666c Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Fri, 7 Jan 2022 17:30:48 +0000 Subject: [PATCH] Add C overload for dawn_native::Adapter::GetProperties This helps Chromium move to using this method and stop using dawn_native::AdapterType/BackendType. Bug: dawn:824 Change-Id: I9e16edd271d3406bc45e3b9fd472bd94bbf53b30 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75583 Auto-Submit: Corentin Wallez Reviewed-by: Brandon Jones Commit-Queue: Brandon Jones --- src/dawn_native/DawnNative.cpp | 4 ++++ src/include/dawn_native/DawnNative.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/dawn_native/DawnNative.cpp b/src/dawn_native/DawnNative.cpp index 03afef264a..0156afb100 100644 --- a/src/dawn_native/DawnNative.cpp +++ b/src/dawn_native/DawnNative.cpp @@ -94,6 +94,10 @@ namespace dawn_native { properties->name = mImpl->GetPCIInfo().name.c_str(); } + void Adapter::GetProperties(WGPUAdapterProperties* properties) const { + GetProperties(reinterpret_cast(properties)); + } + BackendType Adapter::GetBackendType() const { switch (mImpl->GetBackendType()) { case wgpu::BackendType::D3D12: diff --git a/src/include/dawn_native/DawnNative.h b/src/include/dawn_native/DawnNative.h index 79f6fa7afe..f95f12885f 100644 --- a/src/include/dawn_native/DawnNative.h +++ b/src/include/dawn_native/DawnNative.h @@ -108,6 +108,7 @@ namespace dawn_native { // Essentially webgpu.h's wgpuAdapterGetProperties while we don't have WGPUAdapter in // dawn.json void GetProperties(wgpu::AdapterProperties* properties) const; + void GetProperties(WGPUAdapterProperties* properties) const; std::vector GetSupportedExtensions() const; std::vector GetSupportedFeatures() const;