Skip to content

Commit 4ec0698

Browse files
authored
Add subgroups feature (#509)
This has been standardized in the JS API, so we can add it now. Small breaking change by adding items to WGPUAdapterInfo, but these items can always be populated, in the same way they are in JS. Fixes 428
1 parent e599246 commit 4ec0698

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

webgpu.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ typedef enum WGPUFeatureName {
553553
WGPUFeatureName_Float32Blendable = 0x0000000E,
554554
WGPUFeatureName_ClipDistances = 0x0000000F,
555555
WGPUFeatureName_DualSourceBlending = 0x00000010,
556+
WGPUFeatureName_Subgroups = 0x00000011,
556557
WGPUFeatureName_Force32 = 0x7FFFFFFF
557558
} WGPUFeatureName WGPU_ENUM_ATTRIBUTE;
558559

@@ -1591,6 +1592,14 @@ typedef struct WGPUAdapterInfo {
15911592
* The `INIT` macro sets this to `0`.
15921593
*/
15931594
uint32_t deviceID;
1595+
/**
1596+
* The `INIT` macro sets this to `0`.
1597+
*/
1598+
uint32_t subgroupMinSize;
1599+
/**
1600+
* The `INIT` macro sets this to `0`.
1601+
*/
1602+
uint32_t subgroupMaxSize;
15941603
} WGPUAdapterInfo WGPU_STRUCTURE_ATTRIBUTE;
15951604

15961605
/**
@@ -1606,6 +1615,8 @@ typedef struct WGPUAdapterInfo {
16061615
/*.adapterType=*/_wgpu_ENUM_ZERO_INIT(WGPUAdapterType) _wgpu_COMMA \
16071616
/*.vendorID=*/0 _wgpu_COMMA \
16081617
/*.deviceID=*/0 _wgpu_COMMA \
1618+
/*.subgroupMinSize=*/0 _wgpu_COMMA \
1619+
/*.subgroupMaxSize=*/0 _wgpu_COMMA \
16091620
})
16101621

16111622
/**

webgpu.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,9 @@ enums:
478478
- name: dual_source_blending
479479
doc: |
480480
TODO
481+
- name: subgroups
482+
doc: |
483+
TODO
481484
- name: filter_mode
482485
doc: |
483486
TODO
@@ -1564,6 +1567,14 @@ structs:
15641567
doc: |
15651568
TODO
15661569
type: uint32
1570+
- name: subgroup_min_size
1571+
doc: |
1572+
TODO
1573+
type: uint32
1574+
- name: subgroup_max_size
1575+
doc: |
1576+
TODO
1577+
type: uint32
15671578
- name: bind_group_descriptor
15681579
doc: |
15691580
TODO

0 commit comments

Comments
 (0)