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:
Corentin Wallez
2020-01-10 13:28:18 +00:00
committed by Commit Bot service account
parent 5fc2c82c11
commit f12c9dba6d
27 changed files with 237 additions and 143 deletions

View File

@@ -119,7 +119,7 @@ namespace dawn_native { namespace opengl {
class Adapter : public AdapterBase {
public:
Adapter(InstanceBase* instance) : AdapterBase(instance, BackendType::OpenGL) {
Adapter(InstanceBase* instance) : AdapterBase(instance, wgpu::BackendType::OpenGL) {
}
MaybeError Initialize(const AdapterDiscoveryOptions* options) {
@@ -225,7 +225,8 @@ namespace dawn_native { namespace opengl {
// Implementation of the OpenGL backend's BackendConnection
Backend::Backend(InstanceBase* instance) : BackendConnection(instance, BackendType::OpenGL) {
Backend::Backend(InstanceBase* instance)
: BackendConnection(instance, wgpu::BackendType::OpenGL) {
}
std::vector<std::unique_ptr<AdapterBase>> Backend::DiscoverDefaultAdapters() {
@@ -241,7 +242,7 @@ namespace dawn_native { namespace opengl {
return DAWN_VALIDATION_ERROR("The OpenGL backend can only create a single adapter");
}
ASSERT(optionsBase->backendType == BackendType::OpenGL);
ASSERT(optionsBase->backendType == WGPUBackendType_OpenGL);
const AdapterDiscoveryOptions* options =
static_cast<const AdapterDiscoveryOptions*>(optionsBase);

View File

@@ -24,7 +24,7 @@
namespace dawn_native { namespace opengl {
AdapterDiscoveryOptions::AdapterDiscoveryOptions()
: AdapterDiscoveryOptionsBase(BackendType::OpenGL) {
: AdapterDiscoveryOptionsBase(WGPUBackendType_OpenGL) {
}
DawnSwapChainImplementation CreateNativeSwapChainImpl(WGPUDevice device,