From 41428ad681b574566150224df611e3e890bac45f Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Tue, 25 Apr 2023 14:45:38 +0000 Subject: [PATCH] dawn/node: Updates for latest IDL Change-Id: I5028187160fabe8217a39ffc0d20a6fbb59d3cc8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/129001 Reviewed-by: Corentin Wallez Kokoro: Kokoro Commit-Queue: Ben Clayton --- src/dawn/node/binding/Converter.cpp | 1 + src/dawn/node/binding/GPU.cpp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/dawn/node/binding/Converter.cpp b/src/dawn/node/binding/Converter.cpp index 6221ff281e..afbf80b60d 100644 --- a/src/dawn/node/binding/Converter.cpp +++ b/src/dawn/node/binding/Converter.cpp @@ -1702,6 +1702,7 @@ bool Converter::Convert(interop::GPUFeatureName& out, wgpu::FeatureName in) { case wgpu::FeatureName::ChromiumExperimentalDp4a: case wgpu::FeatureName::TimestampQueryInsidePasses: case wgpu::FeatureName::ImplicitDeviceSynchronization: + case wgpu::FeatureName::SurfaceCapabilities: case wgpu::FeatureName::Undefined: return false; } diff --git a/src/dawn/node/binding/GPU.cpp b/src/dawn/node/binding/GPU.cpp index 9998262e72..71153b8eef 100644 --- a/src/dawn/node/binding/GPU.cpp +++ b/src/dawn/node/binding/GPU.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "src/dawn/node/binding/GPUAdapter.h" @@ -229,8 +230,20 @@ interop::GPUTextureFormat GPU::getPreferredCanvasFormat(Napi::Env) { UNIMPLEMENTED(); } -interop::Interface GPU::getWgslLanguageFeatures(Napi::Env) { - UNIMPLEMENTED(); +interop::Interface GPU::getWgslLanguageFeatures(Napi::Env env) { + // TODO(crbug.com/dawn/1777) + struct Features : public interop::WGSLLanguageFeatures { + ~Features() = default; + bool has(Napi::Env, std::string) { + UNIMPLEMENTED(); + return false; + } + std::vector keys(Napi::Env) { + UNIMPLEMENTED(); + return {}; + } + }; + return interop::WGSLLanguageFeatures::Create(env); } } // namespace wgpu::binding