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