skia2/tests/sksl/shared/golden
John Stiles 0777ac4778 Optimize swizzled multiple-argument constructors.
This will reorder constructors with swizzles applied, such as
    `half4(1, 2, 3, 4).xxyz` --> `half4(1, 1, 2, 3)`
    `half4(1, colRGB).yzwx` --> `half4(colRGB.x, colRGB.y, colRGB.z, 1)`

Note that, depending on the swizzle components, some elements of the
constructor may be duplicated and others may be eliminated. The
optimizer makes sure to leave the swizzle alone if it would duplicate
anything non-trivial, or if it would eliminate anything with a side
effect.

Change-Id: I470fda217ae8cf5828406b89a5696ca6aebf608d
Bug: skia:10954
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335860
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-19 17:10:11 +00:00
..
ArrayConstructors.glsl
ArrayConstructors.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ArrayIndexTypes.glsl
ArrayIndexTypes.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ArrayMaxDimensions.glsl Limit arrays to a maximum of eight dimensions. 2020-11-10 16:56:27 +00:00
ArrayMaxDimensions.metal Limit arrays to a maximum of eight dimensions. 2020-11-10 16:56:27 +00:00
ArrayTypes.glsl
ArrayTypes.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Assignment.glsl Add unit tests for assignment and invalid field access. 2020-09-25 21:42:22 +00:00
Assignment.metal Add unit tests for assignment and invalid field access. 2020-09-25 21:42:22 +00:00
BoolFolding.glsl
BoolFolding.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Caps.glsl Disable "any" function workaround in standalone/non-GPU caps 2020-11-03 17:36:43 +00:00
Caps.metal Disable "any" function workaround in standalone/non-GPU caps 2020-11-03 17:36:43 +00:00
CastsRoundTowardZero.glsl
CastsRoundTowardZero.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Clockwise.glsl
Clockwise.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ComplexDelete.glsl Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ComplexDelete.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ConstantIf.glsl
ConstantIf.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ConstArray.glsl
ConstArray.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ConstVariableComparison.glsl
ConstVariableComparison.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Control.glsl
Control.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
CrossIntrinsic.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
CrossIntrinsicStandaloneSettings.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
DeadDoWhileLoop.glsl
DeadDoWhileLoop.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
DeadIfStatement.glsl Fix use-after-free error discovered by the fuzzer. 2020-11-03 17:59:02 +00:00
DeadIfStatement.metal Fix use-after-free error discovered by the fuzzer. 2020-11-03 17:59:02 +00:00
DeadLoopVariable.glsl
DeadLoopVariable.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
DependentInitializers.glsl
DependentInitializers.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Derivatives.glsl
DerivativesFlipY.glsl
DerivativesFlipYStandaloneSettings.glsl
DerivativesStandaloneSettings.glsl
DerivativesUnused.glsl
DerivativesUnused.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Discard.glsl Always declare sk_FragColor in GLSL, even if unused 2020-10-20 21:13:31 +00:00
Discard.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
FloatFolding.glsl
FloatFolding.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
FragCoordsFlipY.glsl
FragCoordsFlipY.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
FragCoordsNew.glsl
FragCoordsNew.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
FragCoordsOld.glsl
FragCoordsOld.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
FrExp.glsl
FrExp.metal Fix frexp support in Metal. 2020-10-20 15:31:31 +00:00
FunctionArgumentMatch.glsl
FunctionArgumentMatch.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
FunctionPrototype.glsl Improve support for function prototypes in SkSL. 2020-11-03 19:09:25 +00:00
FunctionPrototype.metal Improve support for function prototypes in SkSL. 2020-11-03 19:09:25 +00:00
Functions.glsl Fix flipped array dimensions in SkSL. 2020-11-10 18:08:29 +00:00
Functions.metal Fix flipped array dimensions in SkSL. 2020-11-10 18:08:29 +00:00
Geometry.glsl
Geometry.metal Fail gracefully when Metal encounters a geometry shader. 2020-09-25 21:21:50 +00:00
GeometryExtension.glsl
GeometryExtension.metal Fail gracefully when Metal encounters a geometry shader. 2020-09-25 21:21:50 +00:00
GeometryGSInvocations.glsl
GeometryGSInvocations.metal Fail gracefully when Metal encounters a geometry shader. 2020-09-25 21:21:50 +00:00
GeometryNoGSInvocations.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
GeometryNoGSInvocations.metal Fail gracefully when Metal encounters a geometry shader. 2020-09-25 21:21:50 +00:00
GeometryNoGSInvocationsReorder.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
GeometryNoGSInvocationsReorder.metal Add geometry shader test demonstrating max_vertices/invocations bug 2020-10-12 21:19:33 +00:00
Height.glsl
Height.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
HelloWorld.glsl
HelloWorld.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Hex.glsl
Hex.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
InstanceID.glsl
InstanceID.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
InterfaceBlockAnonymous.glsl
InterfaceBlockAnonymous.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
InterfaceBlockArray.glsl
InterfaceBlockArray.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
InterfaceBlockNamed.glsl
InterfaceBlockNamed.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
IntFolding.glsl Add unit test to demonstrate error with modulo in FP files. 2020-10-29 20:46:08 +00:00
IntFolding.metal Add unit test to demonstrate error with modulo in FP files. 2020-10-29 20:46:08 +00:00
Matrices.glsl Convert remaining Metal tests to golden outputs. 2020-11-16 16:32:56 +00:00
Matrices.metal Convert remaining Metal tests to golden outputs. 2020-11-16 16:32:56 +00:00
MatrixFolding.glsl
MatrixFolding.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
MultipleAssignments.glsl
MultipleAssignments.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
NegatedVectorLiteral.glsl Improve constant folding for int vectors. 2020-11-06 17:22:34 +00:00
NegatedVectorLiteral.metal Improve constant folding for int vectors. 2020-11-06 17:22:34 +00:00
NoFragCoordsPos.glsl
NoFragCoordsPos.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
NoFragCoordsPosRT.glsl Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
NoFragCoordsPosRT.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
NormalizationGeo.glsl
NormalizationGeo.metal Report the correct line number when vardecls have an error. 2020-11-17 16:32:23 +00:00
NormalizationVert.glsl Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
NormalizationVert.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
NumberConversions.glsl
NumberConversions.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Offset.glsl
Offset.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Operators.glsl Only include one variable per declaration statement 2020-10-07 17:27:01 +00:00
Operators.metal Only include one variable per declaration statement 2020-10-07 17:27:01 +00:00
Ossfuzz26167.glsl Fix use-after-free discovered by fuzzer. 2020-10-23 16:10:15 +00:00
Ossfuzz26167.metal Fix use-after-free discovered by fuzzer. 2020-10-23 16:10:15 +00:00
Ossfuzz27614.glsl Add fix for fuzzer-discovered crash at oss-fuzz:27614. 2020-11-18 21:01:15 +00:00
Ossfuzz27614.metal Add fix for fuzzer-discovered crash at oss-fuzz:27614. 2020-11-18 21:01:15 +00:00
OutParams.glsl Optimize away swizzles on single-argument constructors. 2020-11-18 17:02:45 +00:00
OutParams.metal Optimize away swizzles on single-argument constructors. 2020-11-18 17:02:45 +00:00
OutParamsTricky.glsl Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
OutParamsTricky.metal Revert "Reland "Remove inliner from IR generation stage."" 2020-10-13 15:20:28 +00:00
RectangleTexture.glsl Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
RectangleTexture.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ResizeMatrix.glsl
ResizeMatrix.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
SampleMask.glsl
SampleMask.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ScopedSymbol.glsl
ScopedSymbol.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
ShortCircuitBoolFolding.glsl
ShortCircuitBoolFolding.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StackingVectorCasts.glsl
StackingVectorCasts.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticIf.glsl
StaticIf.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticSwitch.glsl
StaticSwitch.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticSwitchWithBreak.glsl
StaticSwitchWithBreak.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticSwitchWithBreakInsideBlock.glsl
StaticSwitchWithBreakInsideBlock.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticSwitchWithConditionalBreak.glsl
StaticSwitchWithConditionalBreak.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticSwitchWithConditionalBreakInsideBlock.glsl
StaticSwitchWithConditionalBreakInsideBlock.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticSwitchWithFallthroughA.glsl
StaticSwitchWithFallthroughA.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticSwitchWithFallthroughB.glsl
StaticSwitchWithFallthroughB.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticSwitchWithStaticConditionalBreak.glsl
StaticSwitchWithStaticConditionalBreak.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StaticSwitchWithStaticConditionalBreakInsideBlock.glsl
StaticSwitchWithStaticConditionalBreakInsideBlock.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
StructMaxDepth.glsl Limit struct nesting depth to a maximum of eight levels. 2020-11-10 16:58:37 +00:00
StructMaxDepth.metal Limit struct nesting depth to a maximum of eight levels. 2020-11-10 16:58:37 +00:00
Structs.glsl
Structs.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Switch.glsl
Switch.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
SwitchContainingDeadCode.glsl
SwitchContainingDeadCode.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
SwitchWithFallthrough.glsl
SwitchWithFallthrough.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
SwizzleBoolConstants.glsl Optimize swizzled multiple-argument constructors. 2020-11-19 17:10:11 +00:00
SwizzleBoolConstants.metal Optimize swizzled multiple-argument constructors. 2020-11-19 17:10:11 +00:00
SwizzleConstants.glsl Optimize swizzled multiple-argument constructors. 2020-11-19 17:10:11 +00:00
SwizzleConstants.metal Optimize swizzled multiple-argument constructors. 2020-11-19 17:10:11 +00:00
SwizzleLTRB.glsl
SwizzleLTRB.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
SwizzleOpt.glsl Optimize swizzled multiple-argument constructors. 2020-11-19 17:10:11 +00:00
SwizzleOpt.metal Optimize swizzled multiple-argument constructors. 2020-11-19 17:10:11 +00:00
SwizzleScalar.glsl Optimize swizzled multiple-argument constructors. 2020-11-19 17:10:11 +00:00
SwizzleScalar.metal Optimize swizzled multiple-argument constructors. 2020-11-19 17:10:11 +00:00
TernaryAsLValueEntirelyFoldable.glsl
TernaryAsLValueEntirelyFoldable.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
TernaryAsLValueFoldableTest.glsl Only include one variable per declaration statement 2020-10-07 17:27:01 +00:00
TernaryAsLValueFoldableTest.metal Only include one variable per declaration statement 2020-10-07 17:27:01 +00:00
Texture1D.glsl Split Texture test into separate 1D and 2D tests. 2020-11-02 14:39:31 +00:00
Texture1D.metal Split Texture test into separate 1D and 2D tests. 2020-11-02 14:39:31 +00:00
Texture2D.glsl Split Texture test into separate 1D and 2D tests. 2020-11-02 14:39:31 +00:00
Texture2D.metal Split Texture test into separate 1D and 2D tests. 2020-11-02 14:39:31 +00:00
TextureSharpen.glsl Detect non-2D textures in MetalCodeGenerator and fail cleanly 2020-10-02 20:36:04 +00:00
TextureSharpen.metal Report the correct line number when vardecls have an error. 2020-11-17 16:32:23 +00:00
UnaryPositiveNegative.glsl Allow constant propagation for negated constant-vectors and ints. 2020-11-05 17:39:48 +00:00
UnaryPositiveNegative.metal Allow constant propagation for negated constant-vectors and ints. 2020-11-05 17:39:48 +00:00
UnusedVariables.glsl Only include one variable per declaration statement 2020-10-07 17:27:01 +00:00
UnusedVariables.metal Only include one variable per declaration statement 2020-10-07 17:27:01 +00:00
VectorConstructors.glsl
VectorConstructors.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
VectorFolding.glsl Add fix for fuzzer-discovered crash with negated constructors. 2020-11-18 21:53:45 +00:00
VectorFolding.metal Add fix for fuzzer-discovered crash with negated constructors. 2020-11-18 21:53:45 +00:00
VertexID.glsl
VertexID.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00
Width.glsl
Width.metal Add golden outputs for the Metal backend. 2020-09-25 17:46:43 +00:00