From c1897ae716716b84ea6e5bbd5ca68daf56c50b79 Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Mon, 5 May 2025 17:27:27 -0700 Subject: [PATCH 1/2] Add instance feature for reusable adapters Fixes 535 --- webgpu.h | 6 ++++++ webgpu.yml | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/webgpu.h b/webgpu.h index f7f75a5..ba1ec24 100644 --- a/webgpu.h +++ b/webgpu.h @@ -658,6 +658,12 @@ typedef enum WGPUInstanceFeatureName { * via @ref WGPUShaderSourceSPIRV. */ WGPUInstanceFeatureName_ShaderSourceSPIRV = 0x00000002, + /** + * Normally, a @ref WGPUAdapter can only create a single device. + * If this is available and enabled, then adapters won't immediately expire + * when they create a device. They may still expire for other reasons. + */ + WGPUInstanceFeatureName_ReusableAdapters = 0x00000003, WGPUInstanceFeatureName_Force32 = 0x7FFFFFFF } WGPUInstanceFeatureName WGPU_ENUM_ATTRIBUTE; diff --git a/webgpu.yml b/webgpu.yml index 2132861..701053a 100644 --- a/webgpu.yml +++ b/webgpu.yml @@ -536,6 +536,11 @@ enums: doc: | Enable passing SPIR-V shaders to @ref wgpuDeviceCreateShaderModule, via @ref WGPUShaderSourceSPIRV. + - name: reusable_adapters + doc: | + Normally, a @ref WGPUAdapter can only create a single device. + If this is available and enabled, then adapters won't immediately expire + when they create a device. They may still expire for other reasons. - name: load_op doc: | TODO From 02f4333d90e73918fdeeae25820f4874ae970911 Mon Sep 17 00:00:00 2001 From: Kai Ninomiya Date: Thu, 8 May 2025 21:03:45 -0700 Subject: [PATCH 2/2] rename --- webgpu.h | 9 +++++---- webgpu.yml | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/webgpu.h b/webgpu.h index ba1ec24..e0991c5 100644 --- a/webgpu.h +++ b/webgpu.h @@ -659,11 +659,12 @@ typedef enum WGPUInstanceFeatureName { */ WGPUInstanceFeatureName_ShaderSourceSPIRV = 0x00000002, /** - * Normally, a @ref WGPUAdapter can only create a single device. - * If this is available and enabled, then adapters won't immediately expire - * when they create a device. They may still expire for other reasons. + * Normally, a @ref WGPUAdapter can only create a single device. If this is + * available and enabled, then adapters won't immediately expire when they + * create a device, so can be reused to make multiple devices. They may + * still expire for other reasons. */ - WGPUInstanceFeatureName_ReusableAdapters = 0x00000003, + WGPUInstanceFeatureName_MultipleDevicesPerAdapter = 0x00000003, WGPUInstanceFeatureName_Force32 = 0x7FFFFFFF } WGPUInstanceFeatureName WGPU_ENUM_ATTRIBUTE; diff --git a/webgpu.yml b/webgpu.yml index 701053a..157cd6d 100644 --- a/webgpu.yml +++ b/webgpu.yml @@ -536,11 +536,12 @@ enums: doc: | Enable passing SPIR-V shaders to @ref wgpuDeviceCreateShaderModule, via @ref WGPUShaderSourceSPIRV. - - name: reusable_adapters + - name: multiple_devices_per_adapter doc: | - Normally, a @ref WGPUAdapter can only create a single device. - If this is available and enabled, then adapters won't immediately expire - when they create a device. They may still expire for other reasons. + Normally, a @ref WGPUAdapter can only create a single device. If this is + available and enabled, then adapters won't immediately expire when they + create a device, so can be reused to make multiple devices. They may + still expire for other reasons. - name: load_op doc: | TODO