Add support for enum types in SPIR-V code.

- is_float: Calling `type.columns()` on an arbitrary type isn't safe; it
will assert if the passed-in type is not a scalar/vector/matrix/array.
This was asserting when being passed an enum type. Additionally, this
code would have returned true for arrays of float but that does not
appear to be the intent.

- is_signed: This now returns true for enum types, as these boil down to
int for our purposes.

- is_unsigned/is_bool: Updated structurally to match is_float and
is_signed, but behaviorally unchanged.

- getActualType: now treats enum types as int. This prevents us from
declaring the "OpTypeInt, 32, 1" type twice, which triggers a validator
error: "Duplicate non-aggregate type declarations are not allowed."

These changes are necessary to properly compile Enum.sksl in SPIR-V with
optimizations disabled.

Change-Id: Ib7ae00239c9f87c1a9463e0c8745622743e62cf6
Bug: skia:11304
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368576
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
1 file changed