Skip to content

Add instance feature for reusable adapters #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions webgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,13 @@ 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, so can be reused to make multiple devices. They may
* still expire for other reasons.
*/
WGPUInstanceFeatureName_MultipleDevicesPerAdapter = 0x00000003,
WGPUInstanceFeatureName_Force32 = 0x7FFFFFFF
} WGPUInstanceFeatureName WGPU_ENUM_ATTRIBUTE;

Expand Down
6 changes: 6 additions & 0 deletions webgpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,12 @@ enums:
doc: |
Enable passing SPIR-V shaders to @ref wgpuDeviceCreateShaderModule,
via @ref WGPUShaderSourceSPIRV.
- 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, so can be reused to make multiple devices. They may
still expire for other reasons.
- name: load_op
doc: |
TODO
Expand Down