Add support for top-level uniforms in SPIR-V.
Previously, a uniform not wrapped in an interface block would report a
SPIR-V error:
"Variables identified with the Uniform storage class are
used to access transparent buffer backed resources. Such variables must
be typed as OpTypeStruct, or an array of this type..."
Now, the SPIR-V code generator automatically detects such global
variables and synthesizes a struct named _UniformBuffer to hold them.
When these variables are accessed, an OpAccessChain instruction is added
to grab the variable out of the struct.
Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66
Bug: skia:11225
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
12 files changed