To ensure compatibility, implementation-specific extensions follow a strict naming and numbering convention.
Prefix and Enum Block Registry
Implementations use specific prefixes for new functions/objects and assigned blocks for new enum values. If an implementation is not listed below, it should be added to this registry.
| Implementation | Prefix | Enum Block | Description |
|---|
| Standard | (none) | 0x0000_???? | Extensions standardized in webgpu.h |
| (Reserved) | - | 0x0001_???? | Reserved for future use |
| (Not used) | - | 0x0002_???? | Do not use this block (historical) |
| wgpu-native | Wgpu | 0x0003_???? | - |
| Emscripten | Emscripten | 0x0004_???? | - |
| Dawn | Dawn | 0x0005_???? | - |
| Wagyu | Wagyu | 0x0006_???? | - |
Note: All negative values (MSB set to 1) are reserved for future use.
Extension Design Principles
When working with or implementing extensions, adhere to these rules:
- Enums: Must include a
Force32 = 0x7FFFFFFF value to ensure a stable 32-bit ABI. - Bitflags: Must always be 64-bit.
- Structures: Should be extensible using
nextInChain, or associated with an extensible struct (child, sibling, or parent).