nir/opt_barrier: Generalize to control barriers
For GLSL, we want to optimize code like
memoryBarrierBuffer(); controlBarrier();
into a single scoped_barrier intrinsic for the backend to consume. Now that backends can get scoped_barriers everywhere, what's left is enabling backends to combine these barriers together. We already have an Intel-specific pass for combining memory barriers; it just needs a teensy bit of generalization to allow combining all sorts of barriers together.
This avoids code quality regression on Asahi when switching to purely scoped barriers. It's probably useful for other backends too.
Signed-off-by: Alyssa Rosenzweig alyssa@rosenzweig.io