Reputation: 569
It is clearly stated here that compute shader invocations are executed in parallel within a single work group. And we can synchronize their accesses to memory via barrier() + memoryBarrier()
functions within that single group.
But may actually compute shader work groups within a single dispatch command be executed in parallel?
If so, then am I right, that it is impossible to synchronize their accesses to memory using any GLSL language functions? Because barrier()
works only within a single work group, and so we can use only external synchronization via glMemoryBarrier
to synchronize memory accesses from all work groups, but in this case we have to split compute shader into multiple different shaders, and execute them from separate dispatch commands.
Upvotes: 3
Views: 1480
Reputation: 473272
Invocations from different work groups may be executed in parallel, yes. This is true of pretty much any shader stage's invocations.
And yes, you cannot perform inter-workgroup synchronization. This is also true of pretty much any shader stage; with one other exception, you cannot synchronize between any invocations of the same stage.
Well, not unless you have access to the fragment shader interlock extension, which as the name suggests is limited to fragment shaders.
Upvotes: 3