Wgpu: Implement Subgroup Ops

Created on 12 Feb 2021  路  5Comments  路  Source: gfx-rs/wgpu

Is your feature request related to a problem? Please describe.

https://github.com/gpuweb/gpuweb/pull/1459 is the upstream WIP specification, and this is needed to write high-performance shaders.

Describe the solution you'd like

Subgroup ops implemented either exactly as the upstream spec, or a very similar API that can be converted later.

Describe alternatives you've considered

Not having subgroup ops. This makes GPUs sad.

Additional context

Subgroup ops are critical in some of the algorithms for aggressive triangle culling as you're literally trying to beat the rasterizer at culling triangles. It is also useful whenever you're trying to do any kind of culling.

api performance enhancement

All 5 comments

Please see https://github.com/gpuweb/gpuweb/pull/1459 for updated previews (I had to close the previous PR). Thanks.

Thanks! Updated OP

Assuming that I have compatible hardware, can I use subgroup ops in wgpu-native with SPIR-V right now? Would it cause the validation layer or anything else to complain?

We wouldn't complain right now, but we will at a point where the validation grows enough.
We are also steering towards using Naga everywhere, and it doesn't implement subgroup ops yet.

Subgroup ops will only work on Vulkan right now anyway, as our shader pipeline can't handle them for DX12, though they might work on mtl if spirv-cross supports them. Validation would definitely complain though. Now that we have the ability to run at higher vulkan levels, we should be able to support them, someone just needs to put the work in.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kvark picture kvark  路  15Comments

cloudhead picture cloudhead  路  15Comments

ZKing1000 picture ZKing1000  路  23Comments

lordnoriyuki picture lordnoriyuki  路  21Comments

fintelia picture fintelia  路  23Comments