dc75a97b80
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> |
||
---|---|---|
.. | ||
golden | ||
DoWhileBodyMustBeInlinedIntoAScope.sksl | ||
DoWhileTestCannotBeInlined.sksl | ||
ExponentialGrowth.sksl | ||
ForBodyMustBeInlinedIntoAScope.sksl | ||
ForInitializerExpressionsCanBeInlined.sksl | ||
ForWithoutReturnInsideCanBeInlined.sksl | ||
ForWithReturnInsideCannotBeInlined.sksl | ||
IfBodyMustBeInlinedIntoAScope.sksl | ||
IfElseBodyMustBeInlinedIntoAScope.sksl | ||
IfElseChainWithReturnsCanBeInlined.sksl | ||
IfTestCanBeInlined.sksl | ||
IfWithReturnsCanBeInlined.sksl | ||
InlineKeywordOverridesThreshold.sksl | ||
InlinerAvoidsVariableNameOverlap.sksl | ||
InlinerCanBeDisabled.sksl | ||
InlinerManglesNames.sksl | ||
InlinerWrapsEarlyReturnsWithDoWhileBlock.sksl | ||
InlineThreshold.sksl | ||
InlineWithInoutArgument.sksl | ||
InlineWithModifiedArgument.sksl | ||
InlineWithNestedBigCalls.sksl | ||
InlineWithNestedCalls.sksl | ||
InlineWithUnmodifiedArgument.sksl | ||
InlineWithUnnecessaryBlocks.sksl | ||
ShortCircuitEvaluationsCannotInlineRightHandSide.sksl | ||
SwitchWithCastCanBeInlined.sksl | ||
SwitchWithoutReturnInsideCanBeInlined.sksl | ||
SwitchWithReturnInsideCannotBeInlined.sksl | ||
SwizzleCanBeInlinedDirectly.sksl | ||
TernaryResultsCannotBeInlined.sksl | ||
TernaryTestCanBeInlined.sksl | ||
TrivialArgumentsInlineDirectly.sksl | ||
WhileBodyMustBeInlinedIntoAScope.sksl | ||
WhileTestCannotBeInlined.sksl |