skia2/tests/sksl/inliner
John Stiles dc75a97b80 Add global struct definitions to SkSL.
Previously, GLSL and Metal code generators would emit a struct wherever
the type was first used in the code, regardless of where it was
originally defined or what scope the type needs to live in. This CL adds
a ProgramElement for struct definitions, so that structs will now appear
at the top-level as they were originally defined. In the case of Metal,
some special handling is also needed to handle the Globals struct
properly.

Not yet fully supported:
- No special handling for structs declared inside functions yet
- No support for structs in separate scopes with overlapping names
The severity of the remaining issues depends mostly on whether we want
to support structs inside functions in Runtime Effects.

Change-Id: Ia95d4529506cb3fa6da63f5cb548199a93e1c0c5
Bug: skia:10922, skia:10923, skia:10925, skia:10926
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338600
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-30 15:26:14 +00:00
..
golden Add global struct definitions to SkSL. 2020-11-30 15:26:14 +00:00
DoWhileBodyMustBeInlinedIntoAScope.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
DoWhileTestCannotBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
ExponentialGrowth.sksl Stop the inliner after it has inlined 2500 statements in a program. 2020-11-13 23:02:11 +00:00
ForBodyMustBeInlinedIntoAScope.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
ForInitializerExpressionsCanBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
ForWithoutReturnInsideCanBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
ForWithReturnInsideCannotBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
IfBodyMustBeInlinedIntoAScope.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
IfElseBodyMustBeInlinedIntoAScope.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
IfElseChainWithReturnsCanBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
IfTestCanBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
IfWithReturnsCanBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlineKeywordOverridesThreshold.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlinerAvoidsVariableNameOverlap.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlinerCanBeDisabled.sksl Add test for disabling the inliner. 2020-10-12 17:14:07 +00:00
InlinerManglesNames.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlinerWrapsEarlyReturnsWithDoWhileBlock.sksl Fix unit test for InlinerWrapsEarlyReturnsWithDoWhileBlock. 2020-09-18 21:08:52 +00:00
InlineThreshold.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlineWithInoutArgument.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlineWithModifiedArgument.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlineWithNestedBigCalls.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlineWithNestedCalls.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlineWithUnmodifiedArgument.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
InlineWithUnnecessaryBlocks.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
ShortCircuitEvaluationsCannotInlineRightHandSide.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
SwitchWithCastCanBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
SwitchWithoutReturnInsideCanBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
SwitchWithReturnInsideCannotBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
SwizzleCanBeInlinedDirectly.sksl Add new unit tests for SkSL. 2020-09-23 20:30:47 +00:00
TernaryResultsCannotBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
TernaryTestCanBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
TrivialArgumentsInlineDirectly.sksl Inline trivial single-argument constructors directly. 2020-09-30 17:06:14 +00:00
WhileBodyMustBeInlinedIntoAScope.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00
WhileTestCannotBeInlined.sksl Migrate SkSL inliner tests to golden files. 2020-09-15 15:22:12 +00:00