Add `subgroups-f16` feature dependency validation to subgroups proposal?
Currently in the subgroups proposal we have two WebGPU features, subgroups and subgroups-f16, to enable corresponding WGSL extensions subgroups and subgroups_f16.
Since WebGPU feature subgroups-f16 is to enable using WGSL subgroups_f16 to allow using subgroups built-in function with f16 types, it is unreasonable to require this feature when creating devices without also requiring features shader-f16 and subgroups, and the adapter should report supporting subgroups-f16 only if it also supports shader-f16 and subgroups features. The same idea also applies to the WGSL extensions, i.e. it is unreasonable to enable shader_f16 extension without also enabling f16 and subgroups.
If we are going to keep subgroups-f16 feature and WGSL extension, maybe we can add notes in the subgroups proposal to states e.g.
- When
requestDevicecalled withsubgroups-f16feature required, the returning promise should be rejected with a TypeError ifshader-f16orsubgroupsis not also required.
Such validation rule may add a new aspect of features dependency into the validation.
For WGSL shader, maybe we can add notes like
- It is a shader-creation error if
subgroups_f16extension is enabled without also enablingf16andsubgroups.
That certainly seems reasonable. I think this is the first instance (for WGSL at least) of dependent features.
I was hoping that we won't need an extra feature for this. There are very few devices/drivers that don't support both f16 and subgroups. Metal and D3D12 won't benefit from a subgroups-f16 feature either.
https://github.com/teoxoy/gpuinfo-vulkan-query/blob/8681e0074ece1b251177865203d18b018e05d67a/subgroups.txt#L1416-L1466
We are also limited by the nr of feature/limit buckets we can expose.
I agree that it would be nice to get to that point, but while the proposal lists subgroups-f16 it makes sense to make it dependent. We haven't really discussed removing the option yet to my knowledge in meeting.
At the recent F2F we decided to drop the subgroups-f16 feature.
@alan-baker