[sksl] Reduce memory-order constraints of workgroupBarrier()

The workgroupBarrier() intrinsic was implemented with a combined device,
threadgroup, and texture address space constraints in Metal. This scope
is too large for many use cases that need constraints to apply over a
more narrow subset (workgroup shared memory in particular).

This changes the barrier intrinsic definitions to follow the WGSL
approach which should map cleanly to Metal, WebGPU, Vulkan, GL, and

1. workgroupBarrier() now only implies memory ordering semantics in the
   workgroup address space (i.e. `mem_flags::mem_threadgroup` in Metal).

2. Introduced a storageBarrier() intrinsics that provides memory
   ordering guarantees in storage and uniform address spaces (i.e.

Both intrinsics are intended to be control-barriers that operate in
workgroup execution and memory scope but with different memory
semantics. We can introduce new intrinsics if we want barriers for new
memory semantics (e.g. texture) which is model used in D3D and OpenGL.

An alternative design is to have a single intrinsic that accepts a
bitmask (like in Vulkan and Metal) and have those map to separate
intrinsic calls on WGSL and GLSL.

P.S.: Also re-formatted the intrinsic list enum in SkSLIntrinsicList.h

Change-Id: I00a7450fc27e5feefb318262743c3229dcd4f700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/608719
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
10 files changed