Diff
Modified: trunk/Source/WebGPU/ChangeLog (290269 => 290270)
--- trunk/Source/WebGPU/ChangeLog 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/ChangeLog 2022-02-21 22:09:38 UTC (rev 290270)
@@ -1,5 +1,44 @@
2022-02-21 Myles C. Maxfield <[email protected]>
+ [WebGPU] Tracer bullet part 12: Migrate from C function callbacks to blocks
+ https://bugs.webkit.org/show_bug.cgi?id=236934
+
+ Reviewed by Dean Jackson.
+
+ For all the C function pointer / userdata pairs, simply create a parallel entry point which accepts a block instead.
+
+ * WebGPU/Adapter.mm:
+ (wgpuAdapterRequestDeviceWithBlock):
+ * WebGPU/Buffer.mm:
+ (wgpuBufferMapAsyncWithBlock):
+ * WebGPU/CommandEncoder.mm:
+ (wgpuCommandEncoderSetLabel):
+ * WebGPU/ComputePipeline.mm:
+ (wgpuComputePipelineSetLabel):
+ * WebGPU/Device.mm:
+ (wgpuDeviceCreateComputePipelineAsyncWithBlock):
+ (wgpuDeviceCreateRenderPipelineAsyncWithBlock):
+ (wgpuDevicePopErrorScopeWithBlock):
+ (wgpuDeviceSetDeviceLostCallbackWithBlock):
+ (wgpuDeviceSetUncapturedErrorCallbackWithBlock):
+ * WebGPU/Instance.mm:
+ (wgpuInstanceRequestAdapterWithBlock):
+ * WebGPU/Queue.mm:
+ (wgpuQueueOnSubmittedWorkDoneWithBlock):
+ (wgpuQueueSetLabel):
+ * WebGPU/RenderPipeline.mm:
+ (wgpuRenderPipelineSetLabel):
+ * WebGPU/ShaderModule.mm:
+ (wgpuShaderModuleGetCompilationInfoWithBlock):
+ (wgpuShaderModuleSetLabel):
+ * WebGPU/Surface.mm:
+ (wgpuSurfaceGetPreferredFormat):
+ * WebGPU/SwapChain.mm:
+ (wgpuSwapChainPresent):
+ * WebGPU/WebGPUExt.h:
+
+2022-02-21 Myles C. Maxfield <[email protected]>
+
[WebGPU] Tracer bullet part 11: Implement shader creation methods
https://bugs.webkit.org/show_bug.cgi?id=236933
Modified: trunk/Source/WebGPU/WebGPU/Adapter.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/Adapter.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/Adapter.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -158,3 +158,10 @@
callback(status, device ? new WGPUDeviceImpl { device.releaseNonNull() } : nullptr, message, userdata);
});
}
+
+void wgpuAdapterRequestDeviceWithBlock(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceBlockCallback callback)
+{
+ adapter->adapter->requestDevice(descriptor, [callback] (WGPURequestDeviceStatus status, RefPtr<WebGPU::Device>&& device, const char* message) {
+ callback(status, device ? new WGPUDeviceImpl { device.releaseNonNull() } : nullptr, message);
+ });
+}
Modified: trunk/Source/WebGPU/WebGPU/Buffer.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/Buffer.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/Buffer.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -107,6 +107,13 @@
});
}
+void wgpuBufferMapAsyncWithBlock(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapBlockCallback callback)
+{
+ buffer->buffer->mapAsync(mode, offset, size, [callback] (WGPUBufferMapAsyncStatus status) {
+ callback(status);
+ });
+}
+
void wgpuBufferUnmap(WGPUBuffer buffer)
{
buffer->buffer->unmap();
Modified: trunk/Source/WebGPU/WebGPU/CommandEncoder.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/CommandEncoder.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/CommandEncoder.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -216,4 +216,3 @@
{
commandEncoder->commandEncoder->setLabel(label);
}
-
Modified: trunk/Source/WebGPU/WebGPU/ComputePipeline.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/ComputePipeline.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/ComputePipeline.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -211,4 +211,3 @@
{
computePipeline->computePipeline->setLabel(label);
}
-
Modified: trunk/Source/WebGPU/WebGPU/Device.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/Device.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/Device.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -169,6 +169,13 @@
});
}
+void wgpuDeviceCreateComputePipelineAsyncWithBlock(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncBlockCallback callback)
+{
+ device->device->createComputePipelineAsync(descriptor, [callback] (WGPUCreatePipelineAsyncStatus status, RefPtr<WebGPU::ComputePipeline>&& pipeline, const char* message) {
+ callback(status, pipeline ? new WGPUComputePipelineImpl { pipeline.releaseNonNull() } : nullptr, message);
+ });
+}
+
WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, const WGPUPipelineLayoutDescriptor* descriptor)
{
auto result = device->device->createPipelineLayout(descriptor);
@@ -200,6 +207,13 @@
});
}
+void wgpuDeviceCreateRenderPipelineAsyncWithBlock(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncBlockCallback callback)
+{
+ device->device->createRenderPipelineAsync(descriptor, [callback] (WGPUCreatePipelineAsyncStatus status, RefPtr<WebGPU::RenderPipeline>&& pipeline, const char* message) {
+ callback(status, pipeline ? new WGPURenderPipelineImpl { pipeline.releaseNonNull() } : nullptr, message);
+ });
+}
+
WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, const WGPUSamplerDescriptor* descriptor)
{
auto result = device->device->createSampler(descriptor);
@@ -257,6 +271,13 @@
});
}
+bool wgpuDevicePopErrorScopeWithBlock(WGPUDevice device, WGPUErrorBlockCallback callback)
+{
+ return device->device->popErrorScope([callback] (WGPUErrorType type, const char* message) {
+ callback(type, message);
+ });
+}
+
void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter)
{
device->device->pushErrorScope(filter);
@@ -270,6 +291,14 @@
});
}
+void wgpuDeviceSetDeviceLostCallbackWithBlock(WGPUDevice device, WGPUDeviceLostBlockCallback callback)
+{
+ return device->device->setDeviceLostCallback([callback] (WGPUDeviceLostReason reason, const char* message) {
+ if (callback)
+ callback(reason, message);
+ });
+}
+
void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void* userdata)
{
return device->device->setUncapturedErrorCallback([callback, userdata] (WGPUErrorType type, const char* message) {
@@ -278,6 +307,14 @@
});
}
+void wgpuDeviceSetUncapturedErrorCallbackWithBlock(WGPUDevice device, WGPUErrorBlockCallback callback)
+{
+ return device->device->setUncapturedErrorCallback([callback] (WGPUErrorType type, const char* message) {
+ if (callback)
+ callback(type, message);
+ });
+}
+
void wgpuDeviceSetLabel(WGPUDevice device, const char* label)
{
device->device->setLabel(label);
Modified: trunk/Source/WebGPU/WebGPU/Instance.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/Instance.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/Instance.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -157,9 +157,8 @@
return result ? new WGPUInstanceImpl { result.releaseNonNull() } : nullptr;
}
-WGPUProc wgpuGetProcAddress(WGPUDevice device, const char* procName)
+WGPUProc wgpuGetProcAddress(WGPUDevice, const char* procName)
{
- UNUSED_PARAM(device);
// FIXME: Use gperf to make this faster.
// FIXME: Generate this at build time
if (!strcmp(procName, "wgpuAdapterEnumerateFeatures"))
@@ -172,6 +171,8 @@
return reinterpret_cast<WGPUProc>(&wgpuAdapterHasFeature);
if (!strcmp(procName, "wgpuAdapterRequestDevice"))
return reinterpret_cast<WGPUProc>(&wgpuAdapterRequestDevice);
+ if (!strcmp(procName, "wgpuAdapterRequestDeviceWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuAdapterRequestDeviceWithBlock);
if (!strcmp(procName, "wgpuBufferDestroy"))
return reinterpret_cast<WGPUProc>(&wgpuBufferDestroy);
if (!strcmp(procName, "wgpuBufferGetConstMappedRange"))
@@ -180,6 +181,8 @@
return reinterpret_cast<WGPUProc>(&wgpuBufferGetMappedRange);
if (!strcmp(procName, "wgpuBufferMapAsync"))
return reinterpret_cast<WGPUProc>(&wgpuBufferMapAsync);
+ if (!strcmp(procName, "wgpuBufferMapAsyncWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuBufferMapAsyncWithBlock);
if (!strcmp(procName, "wgpuBufferUnmap"))
return reinterpret_cast<WGPUProc>(&wgpuBufferUnmap);
if (!strcmp(procName, "wgpuCommandEncoderBeginComputePass"))
@@ -246,6 +249,8 @@
return reinterpret_cast<WGPUProc>(&wgpuDeviceCreateComputePipeline);
if (!strcmp(procName, "wgpuDeviceCreateComputePipelineAsync"))
return reinterpret_cast<WGPUProc>(&wgpuDeviceCreateComputePipelineAsync);
+ if (!strcmp(procName, "wgpuDeviceCreateComputePipelineAsyncWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuDeviceCreateComputePipelineAsyncWithBlock);
if (!strcmp(procName, "wgpuDeviceCreatePipelineLayout"))
return reinterpret_cast<WGPUProc>(&wgpuDeviceCreatePipelineLayout);
if (!strcmp(procName, "wgpuDeviceCreateQuerySet"))
@@ -256,6 +261,8 @@
return reinterpret_cast<WGPUProc>(&wgpuDeviceCreateRenderPipeline);
if (!strcmp(procName, "wgpuDeviceCreateRenderPipelineAsync"))
return reinterpret_cast<WGPUProc>(&wgpuDeviceCreateRenderPipelineAsync);
+ if (!strcmp(procName, "wgpuDeviceCreateRenderPipelineAsyncWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuDeviceCreateRenderPipelineAsyncWithBlock);
if (!strcmp(procName, "wgpuDeviceCreateSampler"))
return reinterpret_cast<WGPUProc>(&wgpuDeviceCreateSampler);
if (!strcmp(procName, "wgpuDeviceCreateShaderModule"))
@@ -276,12 +283,18 @@
return reinterpret_cast<WGPUProc>(&wgpuDeviceHasFeature);
if (!strcmp(procName, "wgpuDevicePopErrorScope"))
return reinterpret_cast<WGPUProc>(&wgpuDevicePopErrorScope);
+ if (!strcmp(procName, "wgpuDevicePopErrorScopeWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuDevicePopErrorScopeWithBlock);
if (!strcmp(procName, "wgpuDevicePushErrorScope"))
return reinterpret_cast<WGPUProc>(&wgpuDevicePushErrorScope);
if (!strcmp(procName, "wgpuDeviceSetDeviceLostCallback"))
return reinterpret_cast<WGPUProc>(&wgpuDeviceSetDeviceLostCallback);
+ if (!strcmp(procName, "wgpuDeviceSetDeviceLostCallbackWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuDeviceSetDeviceLostCallbackWithBlock);
if (!strcmp(procName, "wgpuDeviceSetUncapturedErrorCallback"))
return reinterpret_cast<WGPUProc>(&wgpuDeviceSetUncapturedErrorCallback);
+ if (!strcmp(procName, "wgpuDeviceSetUncapturedErrorCallbackWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuDeviceSetUncapturedErrorCallbackWithBlock);
if (!strcmp(procName, "wgpuGetProcAddress"))
return reinterpret_cast<WGPUProc>(&wgpuGetProcAddress);
if (!strcmp(procName, "wgpuInstanceCreateSurface"))
@@ -290,10 +303,14 @@
return reinterpret_cast<WGPUProc>(&wgpuInstanceProcessEvents);
if (!strcmp(procName, "wgpuInstanceRequestAdapter"))
return reinterpret_cast<WGPUProc>(&wgpuInstanceRequestAdapter);
+ if (!strcmp(procName, "wgpuInstanceRequestAdapterWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuInstanceRequestAdapterWithBlock);
if (!strcmp(procName, "wgpuQuerySetDestroy"))
return reinterpret_cast<WGPUProc>(&wgpuQuerySetDestroy);
if (!strcmp(procName, "wgpuQueueOnSubmittedWorkDone"))
return reinterpret_cast<WGPUProc>(&wgpuQueueOnSubmittedWorkDone);
+ if (!strcmp(procName, "wgpuQueueOnSubmittedWorkDoneWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuQueueOnSubmittedWorkDoneWithBlock);
if (!strcmp(procName, "wgpuQueueSubmit"))
return reinterpret_cast<WGPUProc>(&wgpuQueueSubmit);
if (!strcmp(procName, "wgpuQueueWriteBuffer"))
@@ -372,6 +389,8 @@
return reinterpret_cast<WGPUProc>(&wgpuRenderPipelineSetLabel);
if (!strcmp(procName, "wgpuShaderModuleGetCompilationInfo"))
return reinterpret_cast<WGPUProc>(&wgpuShaderModuleGetCompilationInfo);
+ if (!strcmp(procName, "wgpuShaderModuleGetCompilationInfoWithBlock"))
+ return reinterpret_cast<WGPUProc>(&wgpuShaderModuleGetCompilationInfoWithBlock);
if (!strcmp(procName, "wgpuShaderModuleSetLabel"))
return reinterpret_cast<WGPUProc>(&wgpuShaderModuleSetLabel);
if (!strcmp(procName, "wgpuSurfaceGetPreferredFormat"))
@@ -405,3 +424,9 @@
});
}
+void wgpuInstanceRequestAdapterWithBlock(WGPUInstance instance, WGPURequestAdapterOptions const * options, WGPURequestAdapterBlockCallback callback)
+{
+ instance->instance->requestAdapter(options, [callback] (WGPURequestAdapterStatus status, RefPtr<WebGPU::Adapter>&& adapter, const char* message) {
+ callback(status, adapter ? new WGPUAdapterImpl { adapter.releaseNonNull() } : nullptr, message);
+ });
+}
Modified: trunk/Source/WebGPU/WebGPU/Queue.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/Queue.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/Queue.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -85,6 +85,13 @@
});
}
+void wgpuQueueOnSubmittedWorkDoneWithBlock(WGPUQueue queue, uint64_t signalValue, WGPUQueueWorkDoneBlockCallback callback)
+{
+ queue->queue->onSubmittedWorkDone(signalValue, [callback] (WGPUQueueWorkDoneStatus status) {
+ callback(status);
+ });
+}
+
void wgpuQueueSubmit(WGPUQueue queue, uint32_t commandCount, const WGPUCommandBuffer* commands)
{
Vector<std::reference_wrapper<const WebGPU::CommandBuffer>> commandsToForward;
@@ -107,4 +114,3 @@
{
queue->queue->setLabel(label);
}
-
Modified: trunk/Source/WebGPU/WebGPU/RenderPipeline.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/RenderPipeline.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/RenderPipeline.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -77,4 +77,3 @@
{
renderPipeline->renderPipeline->setLabel(label);
}
-
Modified: trunk/Source/WebGPU/WebGPU/ShaderModule.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/ShaderModule.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/ShaderModule.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -257,8 +257,14 @@
});
}
+void wgpuShaderModuleGetCompilationInfoWithBlock(WGPUShaderModule shaderModule, WGPUCompilationInfoBlockCallback callback)
+{
+ shaderModule->shaderModule->getCompilationInfo([callback] (WGPUCompilationInfoRequestStatus status, const WGPUCompilationInfo* compilationInfo) {
+ callback(status, compilationInfo);
+ });
+}
+
void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, const char* label)
{
shaderModule->shaderModule->setLabel(label);
}
-
Modified: trunk/Source/WebGPU/WebGPU/Surface.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/Surface.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/Surface.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -51,4 +51,3 @@
{
return surface->surface->getPreferredFormat(adapter->adapter);
}
-
Modified: trunk/Source/WebGPU/WebGPU/SwapChain.mm (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/SwapChain.mm 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/SwapChain.mm 2022-02-21 22:09:38 UTC (rev 290270)
@@ -67,4 +67,3 @@
{
swapChain->swapChain->present();
}
-
Modified: trunk/Source/WebGPU/WebGPU/WebGPUExt.h (290269 => 290270)
--- trunk/Source/WebGPU/WebGPU/WebGPUExt.h 2022-02-21 22:06:36 UTC (rev 290269)
+++ trunk/Source/WebGPU/WebGPU/WebGPUExt.h 2022-02-21 22:09:38 UTC (rev 290270)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Apple Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,6 +30,16 @@
extern "C" {
#endif
+typedef void (^WGPUBufferMapBlockCallback)(WGPUBufferMapAsyncStatus status);
+typedef void (^WGPUCompilationInfoBlockCallback)(WGPUCompilationInfoRequestStatus status, WGPUCompilationInfo const * compilationInfo);
+typedef void (^WGPUCreateComputePipelineAsyncBlockCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message);
+typedef void (^WGPUCreateRenderPipelineAsyncBlockCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message);
+typedef void (^WGPUDeviceLostBlockCallback)(WGPUDeviceLostReason reason, char const * message);
+typedef void (^WGPUErrorBlockCallback)(WGPUErrorType type, char const * message);
+typedef void (^WGPUQueueWorkDoneBlockCallback)(WGPUQueueWorkDoneStatus status);
+typedef void (^WGPURequestAdapterBlockCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message);
+typedef void (^WGPURequestDeviceBlockCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message);
+
typedef enum WGPUSTypeExtended {
WGPUSTypeExtended_ShaderModuleDescriptorHints = 0x348970F3, // Random
WGPUSTypeExtended_TextureDescriptorViewFormats = 0x1D5BC57, // Random
@@ -101,6 +111,17 @@
typedef void (*WGPUProcTextureSetLabel)(WGPUTexture sampler, char const * label);
typedef void (*WGPUProcTextureViewSetLabel)(WGPUTextureView sampler, char const * label);
+typedef void (*WGPUProcAdapterRequestDeviceWithBlock)(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceBlockCallback callback);
+typedef void (*WGPUProcBufferMapAsyncWithBlock)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapBlockCallback callback);
+typedef void (*WGPUProcDeviceCreateComputePipelineAsyncWithBlock)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncBlockCallback callback);
+typedef void (*WGPUProcDeviceCreateRenderPipelineAsyncWithBlock)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncBlockCallback callback);
+typedef bool (*WGPUProcDevicePopErrorScopeWithBlock)(WGPUDevice device, WGPUErrorBlockCallback callback);
+typedef void (*WGPUProcDeviceSetDeviceLostCallbackWithBlock)(WGPUDevice device, WGPUDeviceLostBlockCallback callback);
+typedef void (*WGPUProcDeviceSetUncapturedErrorCallbackWithBlock)(WGPUDevice device, WGPUErrorBlockCallback callback);
+typedef void (*WGPUProcInstanceRequestAdapterWithBlock)(WGPUInstance instance, WGPURequestAdapterOptions const * options, WGPURequestAdapterBlockCallback callback);
+typedef void (*WGPUProcQueueOnSubmittedWorkDoneWithBlock)(WGPUQueue queue, uint64_t signalValue, WGPUQueueWorkDoneBlockCallback callback);
+typedef void (*WGPUProcShaderModuleGetCompilationInfoWithBlock)(WGPUShaderModule shaderModule, WGPUCompilationInfoBlockCallback callback);
+
#endif // !defined(WGPU_SKIP_PROCS)
#if !defined(WGPU_SKIP_DECLARATIONS)
@@ -146,6 +167,17 @@
WGPU_EXPORT void wgpuTextureSetLabel(WGPUTexture sampler, char const * label);
WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView sampler, char const * label);
+WGPU_EXPORT void wgpuAdapterRequestDeviceWithBlock(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceBlockCallback callback);
+WGPU_EXPORT void wgpuBufferMapAsyncWithBlock(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapBlockCallback callback);
+WGPU_EXPORT void wgpuDeviceCreateComputePipelineAsyncWithBlock(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncBlockCallback callback);
+WGPU_EXPORT void wgpuDeviceCreateRenderPipelineAsyncWithBlock(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncBlockCallback callback);
+WGPU_EXPORT bool wgpuDevicePopErrorScopeWithBlock(WGPUDevice device, WGPUErrorBlockCallback callback);
+WGPU_EXPORT void wgpuDeviceSetDeviceLostCallbackWithBlock(WGPUDevice device, WGPUDeviceLostBlockCallback callback);
+WGPU_EXPORT void wgpuDeviceSetUncapturedErrorCallbackWithBlock(WGPUDevice device, WGPUErrorBlockCallback callback);
+WGPU_EXPORT void wgpuInstanceRequestAdapterWithBlock(WGPUInstance instance, WGPURequestAdapterOptions const * options, WGPURequestAdapterBlockCallback callback);
+WGPU_EXPORT void wgpuQueueOnSubmittedWorkDoneWithBlock(WGPUQueue queue, uint64_t signalValue, WGPUQueueWorkDoneBlockCallback callback);
+WGPU_EXPORT void wgpuShaderModuleGetCompilationInfoWithBlock(WGPUShaderModule shaderModule, WGPUCompilationInfoBlockCallback callback);
+
#endif // !defined(WGPU_SKIP_DECLARATIONS)
#ifdef __cplusplus