Add LValue class to WGSL code generator.

Previously, `assembleExpression` was assumed to return a WGSL-
assignable expression if the expression was assignable in SkSL.
This assumption breaks in the presence of SkSL-assignable
expressions that are not assignable in WGSL, such as swizzled
variables.

We now have an `LValue` class which represents an assignable
expression. Like the SPIR-V class of the same name, it allows
loads and stores, and will allow the application of swizzles.

Expressions with side-effects now _always_ cause those side
effects to occur in separate leading statements. An expression
returned by `assembleExpression` may be complex, but must have
no side-effect. This fixes the issue of nonsense expression-
statements like `Foo() + Bar()` which are not legal in WGSL, but
are valid in SkSL and cause Foo() and Bar() to be invoked.

At this CL, WGSL LValues only support simple variable references.
This means that some tests which used to generate valid code
will now generate an error. This will be fixed in followup CLs.
Fortunately, the CLs which do work generate nicer code than
before; we no longer need to generate scratch pointers anywhere.

Bug: skia:14082
Change-Id: I16919fdf5c022e38428f522bcffa2d52e859757a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/706217
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
46 files changed