diff --git a/src/dawn/node/binding/Converter.cpp b/src/dawn/node/binding/Converter.cpp index 95c49162a9..f2718bd886 100644 --- a/src/dawn/node/binding/Converter.cpp +++ b/src/dawn/node/binding/Converter.cpp @@ -1609,8 +1609,14 @@ bool Converter::Convert(wgpu::QueryType& out, const interop::GPUQueryType& in) { out = wgpu::QueryType::Occlusion; return true; case interop::GPUQueryType::kTimestamp: - out = wgpu::QueryType::Timestamp; - return true; + if (HasFeature(wgpu::FeatureName::TimestampQuery)) { + out = wgpu::QueryType::Timestamp; + return true; + } else { + Napi::TypeError::New(env, "invalid value for GPUQueryType") + .ThrowAsJavaScriptException(); + return false; + } } Napi::Error::New(env, "invalid value for GPUQueryType").ThrowAsJavaScriptException(); return false; diff --git a/src/dawn/node/binding/GPUDevice.cpp b/src/dawn/node/binding/GPUDevice.cpp index b540d501a5..5aab3eb0b8 100644 --- a/src/dawn/node/binding/GPUDevice.cpp +++ b/src/dawn/node/binding/GPUDevice.cpp @@ -472,7 +472,7 @@ interop::Interface GPUDevice::createRenderBundl interop::Interface GPUDevice::createQuerySet( Napi::Env env, interop::GPUQuerySetDescriptor descriptor) { - Converter conv(env); + Converter conv(env, device_); wgpu::QuerySetDescriptor desc{}; if (!conv(desc.label, descriptor.label) || !conv(desc.type, descriptor.type) ||