Enforce layout offsets and types for WGSL interface blocks.

We now reject a program if it contains a type in its interface
blocks which isn't supported by std140. Additionally, we now
annotate fields with @size(N), if the field and the following field
both have offsets. By explicitly declaring a size for each element,
we effectively have the ability to set a field's offset in the struct.

I originally copied the Metal code generator logic for
inserting packing, but I think the @size approach is actually
better; we don't need to insert inert padding elements into the
structs.

Bug: skia:13092
Change-Id: I6c4bcb4d30cc2306c2d815e94ca60004d4c792d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/729259
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
7 files changed