Skip to content

nak: Rework barrier handling a bit

Faith Ekstrand requested to merge gfxstrand/mesa:nak-rework-barrier into main

Previously, we would only emit OpBar in compute because the hardware would complain in tessellation. The real reason for this, however, is that tessellation evaluation shaders don't really have workgroups at all. They just have a subgroup. The GL and Vulkan limits on the number of tessellation invocations are such that an entire tessellation "workgroup" fits inside a single subgroup.

We already have code which removes workgroup control barriers whenever we have one subgroup. It was originally implemented as an optimization for compute shaders now that we have warp barriers ensuring re-convergence. We can easily make it remove all control barriers in tessellation shaders as well by just tweaking the function. This will also be useful for mesh shaders going forward.

Cc @marysaka

Merge request reports