SkSL: Start refactoring pre-include handling

This makes IRIntrinsicMap an actual type, and supports chaining (so an
intrinsic map can have a parent, just like a symbol table). That lets us
put Enums and defined functions at multiple levels of the pre-include
hierarchy.

With that done, we add an intrinsic map for sksl_fp.sksl, containing the
enum declarations from that file. This lets .fp processing using the FP
intrinsic map (which is parented to the GPU one) to resolve those enums
(PMConversion, GrClipEdgeType), as well as the enums in sksl_gpu
(SkBlendMode).

Because sksl_fp was being used to generate an inherited element list
(containing several builtin variables), I have relaxed the restriction
around grab_intrinsics - unsupported element types are simply left in
the original vector, unchanged. for the GPU and interpreter intrinsic
maps (where the element lists are discarded), we still assert that we
didn't end up with any unsupported elements.

Doing all of this lets us remove the redundant enum resolution code in
IR generator (where we previously supported looking up enums in both the
inherited element list, and in the intrinsic map).

Subsequent changes will add support for variables/declarations to the
intrinsic map, so we won't need both the inherited list and the
intrinsic map, if all goes well.

Change-Id: Ic6174511e5f8d68f65e4919f2ec0b923717d6cd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/318212
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
4 files changed