From 24165e31ed4626d07bd16c423eca068fa318836d Mon Sep 17 00:00:00 2001 From: Mridul Goyal Date: Wed, 19 Nov 2025 09:34:46 +0000 Subject: [PATCH 1/2] Add docs for `device_lost` callback and `buffer.map_async` args --- webgpu.h | 7 +++++++ webgpu.json | 6 +++--- webgpu.yml | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/webgpu.h b/webgpu.h index f9ffb92..478dd14 100644 --- a/webgpu.h +++ b/webgpu.h @@ -1407,7 +1407,11 @@ typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncSta * (2) The last ref of the device has been (or is being) released: see @ref DeviceRelease. * This parameter is @ref PassedWithoutOwnership. * + * @param reason + * An error code explaining why the device was lost. + * * @param message + * Textual description of the error. * This parameter is @ref PassedWithoutOwnership. */ typedef void (*WGPUDeviceLostCallback)(WGPUDevice const * device, WGPUDeviceLostReason reason, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; @@ -5937,6 +5941,9 @@ WGPU_EXPORT WGPUBufferMapState wgpuBufferGetMapState(WGPUBuffer buffer) WGPU_FUN WGPU_EXPORT uint64_t wgpuBufferGetSize(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; WGPU_EXPORT WGPUBufferUsage wgpuBufferGetUsage(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; /** + * @param mode + * The mapping mode (read or write). + * * @param offset * Byte offset relative to beginning of the buffer. * diff --git a/webgpu.json b/webgpu.json index 2383753..8fb6748 100644 --- a/webgpu.json +++ b/webgpu.json @@ -253,12 +253,12 @@ "type": "object.device" }, { - "doc": "TODO\n", + "doc": "An error code explaining why the device was lost.\n", "name": "reason", "type": "enum.device_lost_reason" }, { - "doc": "TODO\n", + "doc": "Textual description of the error.\n", "name": "message", "passed_with_ownership": false, "type": "out_string" @@ -2577,7 +2577,7 @@ { "args": [ { - "doc": "TODO\n", + "doc": "The mapping mode (read or write).\n", "name": "mode", "type": "bitflag.map_mode" }, diff --git a/webgpu.yml b/webgpu.yml index 45d0d6f..73adc51 100644 --- a/webgpu.yml +++ b/webgpu.yml @@ -3482,11 +3482,11 @@ callbacks: passed_with_ownership: false - name: reason doc: | - TODO + An error code explaining why the device was lost. type: enum.device_lost_reason - name: message doc: | - TODO + Textual description of the error. type: out_string passed_with_ownership: false - name: pop_error_scope @@ -3732,7 +3732,7 @@ objects: args: - name: mode doc: | - TODO + The mapping mode (read or write). type: bitflag.map_mode - name: offset doc: | From 00702b0000dc95b21dc3dca9ddbd00db5e58725f Mon Sep 17 00:00:00 2001 From: Mridul Goyal Date: Wed, 19 Nov 2025 09:34:46 +0000 Subject: [PATCH 2/2] Add docs for `device_lost` callback and `buffer.map_async` args --- webgpu.h | 2 +- webgpu.json | 2 +- webgpu.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/webgpu.h b/webgpu.h index 0e03ab5..8e630ae 100644 --- a/webgpu.h +++ b/webgpu.h @@ -1412,7 +1412,7 @@ typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncSta * An error code explaining why the device was lost. * * @param message - * Textual description of the error. + * A @ref LocalizableHumanReadableMessageString describing why the device was lost. * This parameter is @ref PassedWithoutOwnership. */ typedef void (*WGPUDeviceLostCallback)(WGPUDevice const * device, WGPUDeviceLostReason reason, WGPUStringView message, WGPU_NULLABLE void* userdata1, WGPU_NULLABLE void* userdata2) WGPU_FUNCTION_ATTRIBUTE; diff --git a/webgpu.json b/webgpu.json index 2ead0a9..0739495 100644 --- a/webgpu.json +++ b/webgpu.json @@ -258,7 +258,7 @@ "type": "enum.device_lost_reason" }, { - "doc": "Textual description of the error.\n", + "doc": "A @ref LocalizableHumanReadableMessageString describing why the device was lost.\n", "name": "message", "passed_with_ownership": false, "type": "out_string" diff --git a/webgpu.yml b/webgpu.yml index d76e21c..b7d4459 100644 --- a/webgpu.yml +++ b/webgpu.yml @@ -3489,7 +3489,7 @@ callbacks: type: enum.device_lost_reason - name: message doc: | - Textual description of the error. + A @ref LocalizableHumanReadableMessageString describing why the device was lost. type: out_string passed_with_ownership: false - name: pop_error_scope