f4103618ff
GLSL ES2 behavior is explicitly undefined if an out-param is never written to: "If a function does not write to an out parameter, the value of the actual parameter is undefined when the function returns." We do see divergence here in practice: SkVM's behavior (the parameter is left alone) differs from my GPU's behavior (the parameter is zeroed out). SkSL will now report an error if an out parameter is never assigned-to. There is no control flow analysis performed, so we will not report cases where the out parameter is assigned-to on some paths but not others. (Technically the return-on-all-paths logic could be adapted for this, but it would be a fair amount of work.) Structs are currently exempt from the rule because custom mesh specifications require an `out` parameter for a Varyings struct, even if your mesh program doesn't need Varyings. Bug: skia:12867 Change-Id: Ie828d3ce91c2c67e008ae304fdb163ffa88d744c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500440 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> |
||
---|---|---|
.. | ||
AllowNarrowingConversions.rts | ||
ArrayIndexing.rts | ||
ArrayNarrowingConversions.rts | ||
Blend.rtb | ||
Commutative.rts | ||
ConstPreservation.rts | ||
ConversionConstructors.rts | ||
GlobalVariables.rts | ||
GLSLTypeNames.rts | ||
LargeProgram_BlocklessLoops.rts | ||
LargeProgram_FlatLoop.rts | ||
LargeProgram_Functions.rts | ||
LargeProgram_NestedLoops.rts | ||
LargeProgram_SplitLoops.rts | ||
LargeProgram_StackDepth.rts | ||
LargeProgram_ZeroIterFor.rts | ||
LoopFloat.rts | ||
LoopInt.rts | ||
PrecisionQualifiers.rts | ||
QualifierOrder.rts | ||
RecursiveComparison_Arrays.rts | ||
RecursiveComparison_Structs.rts | ||
RecursiveComparison_Types.rts | ||
RecursiveComparison_Vectors.rts | ||
SampleWithExplicitCoord.rts | ||
Switch.rts | ||
SwitchDefaultOnly.rts | ||
SwitchWithFallthrough.rts | ||
SwitchWithLoops.rts | ||
VectorIndexing.rts |