skia2/resources/sksl/shared
Arman Uguray 5f16ed4c58 [sksl] Special-case unary negation on matrix types in MSL/SPIR-V
MSL does not support the unary "-" operator on matrix types. Similarly
the SPIR-V OpFNegate/OpSNegate operations only work on scalar and vector
type.

* An expression such as "-<mat>" is now transformed to "-1.0 * <mat>" when
generating MSL.
* The same expression now generates a component-wise negation in SPIR-V,
matching what glslang outputs for GLSL.
* A unary "+" is now treated as NOP for MSL, matching the SPIR-V backend.
An expression such as "+<expr>" is now evaluated as "<expr>".
* The shared/Negation.sksl has been moved to folding/ as much of its
contents exercise constant-folding of comparison expressions.
* The shared/UnaryPositiveNegative.sksl test has been extended to
exercise scalar and matrix types.

NOTE: The SPIR-V backend changes have caused a minor re-ordering of SSA
IDs generated when writing out a prefix-expression. The affected gold
files have been updated.

Bug: skia:12627, skia:12992
Change-Id: Iec5cdafc591aed7e49b3b52bda42a02661380bab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/513976
Auto-Submit: Arman Uguray <armansito@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
2022-03-01 20:14:46 +00:00
..
ArrayCast.sksl Add support for array-cast syntax in SkSL. 2021-08-11 12:56:40 +00:00
ArrayComparison.sksl Confirm that GLSL codegen always emits array-size after the identifier. 2022-01-06 17:11:19 +00:00
ArrayConstructors.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ArrayFollowedByScalar.sksl Demonstrate parsing error with structs and arrays. 2021-08-25 17:26:54 +00:00
ArrayIndexTypes.sksl
ArrayNarrowingConversions.sksl Add tests for array assignment with narrowing conversions. 2021-08-11 12:56:40 +00:00
ArrayTypes.sksl Fix array-of-struct name mangling in Pipeline stage. 2021-04-28 21:02:36 +00:00
Assignment.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
Caps.sksl
CastsRoundTowardZero.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
Clockwise.sksl
CommaMixedTypes.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
CommaSideEffects.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ComplexDelete.sksl Reland "Restrict where 'binding' and 'set' can appear" 2021-11-23 18:03:24 +00:00
ConstantIf.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ConstArray.sksl Enable proper testing of const arrays. 2021-05-14 13:37:12 +00:00
ConstVariableComparison.sksl Cleanup TODO for constant-expression handling. 2021-05-14 13:36:33 +00:00
Control.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
DeadDoWhileLoop.sksl
DeadIfStatement.sksl Fix test when optimizations are off. 2021-11-10 20:17:30 +00:00
DeadLoopVariable.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
DeadReturn.sksl Reland "Eliminate unreachable code during optimization." 2021-05-20 20:02:15 +00:00
DeadReturnES3.sksl Reland "Eliminate unreachable code during optimization." 2021-05-20 20:02:15 +00:00
DeadStripFunctions.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
DependentInitializers.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
Derivatives.sksl
DerivativesUnused.sksl
Discard.sksl Optimize @switch statements in SwitchStatement::Make. 2021-02-23 21:36:04 +00:00
DoWhileControlFlow.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
EmptyBlocksES2.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
EmptyBlocksES3.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
ForLoopControlFlow.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ForLoopMultipleInit.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
FragCoords.sksl Reland "Don't key progams/pipelines on origin."" 2021-07-07 14:50:10 +00:00
FunctionAnonymousParameters.sksl Add test containing anonymous function parameters. 2021-12-28 20:08:56 +00:00
FunctionArgTypeMatch.sksl Allow function declarations to take (void). 2021-05-21 19:21:23 +00:00
FunctionPrototype.sksl Add support for function prototypes in Pipeline stage. 2021-09-30 20:02:19 +00:00
FunctionReturnTypeMatch.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
Functions.sksl Fix ES2 conformance test 'in_vs_no_in'. 2021-10-11 22:27:37 +00:00
GaussianBlur.sksl
GeometricIntrinsics.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
HelloWorld.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
Hex.sksl Add support for 0XABCD style hex literals. 2021-10-13 12:41:54 +00:00
HexUnsigned.sksl Add parser support for u suffix on literals. 2021-11-16 13:50:14 +00:00
InoutParameters.sksl Fix up test SkSLInlineWithInoutArgument. 2022-01-25 21:33:45 +00:00
InstanceID.vert
InterfaceBlockNamed.sksl
InterfaceBlockNamedArray.sksl Add default uniform binding value for Metal/SPIR-V. 2021-01-28 19:23:49 +00:00
Matrices.sksl Revert "Disallow matrix ctors which overflow a column." 2021-10-14 01:30:08 +00:00
MatricesNonsquare.sksl Revert "Disallow matrix ctors which overflow a column." 2021-10-14 01:30:08 +00:00
MatrixConstructorsES2.sksl Revert "Disallow matrix ctors which overflow a column." 2021-10-14 01:30:08 +00:00
MatrixConstructorsES3.sksl Revert "Disallow matrix ctors which overflow a column." 2021-10-14 01:30:08 +00:00
MatrixEquality.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
MatrixScalarMath.sksl Reland "Better Matrix/Scalar testing" 2022-01-14 19:12:00 +00:00
MatrixToVectorCast.sksl Fix diagonal-matrix assertion discovered by fuzzer. 2021-08-23 17:33:42 +00:00
MultipleAssignments.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
NoFragCoordsPos.vert Change sksl tests to avoid SPIR-V validation errors 2021-03-16 13:39:53 +00:00
NoFragCoordsPosRT.vert Reland "Restrict where 'binding' and 'set' can appear" 2021-11-23 18:03:24 +00:00
NormalizationVert.vert Reland "Restrict where 'binding' and 'set' can appear" 2021-11-23 18:03:24 +00:00
NumberCasts.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
NumberConversions.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
Octal.sksl Add parser support for u suffix on literals. 2021-11-16 13:50:14 +00:00
Offset.sksl
OperatorsES2.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
OperatorsES3.sksl Add parser support for u suffix on literals. 2021-11-16 13:50:14 +00:00
Ossfuzz26167.sksl
Ossfuzz26759.sksl Fix up outdated tests. 2021-03-22 21:11:47 +00:00
Ossfuzz28794.sksl
Ossfuzz28904.sksl
Ossfuzz29085.sksl Fix various fuzzer-generated tests. 2021-04-12 13:44:59 +00:00
Ossfuzz29494.sksl Use unsigned values when constant-folding integer vectors 2021-02-01 21:44:28 +00:00
Ossfuzz36770.sksl Fix for fuzzer-discovered error in SPIR-V with RTFlip. 2021-08-02 17:13:50 +00:00
Ossfuzz36852.sksl Fix fuzzer-discovered error with swizzling matrices. 2021-08-05 21:59:23 +00:00
Ossfuzz37466.sksl Fix inliner bug discovered by fuzzer. 2021-08-24 14:44:43 +00:00
Ossfuzz37677.sksl Fix invalid variable ref-kind discovered by fuzzer. 2021-08-27 14:01:21 +00:00
Ossfuzz37900.sksl Fix array timeout discovered by the fuzzer. 2021-08-31 19:55:45 +00:00
Ossfuzz41000.sksl Replace getConstantSubexpression with getConstantValue. 2021-11-15 14:46:21 +00:00
OutParams.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
OutParamsAreDistinct.sksl Fix up SkSL test on Wembley. 2022-01-31 21:17:40 +00:00
OutParamsTricky.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
Overflow.sksl Add overflow protection to vector-arithmetic folding. 2021-10-27 16:49:02 +00:00
RectangleTexture.sksl
ResizeMatrix.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ResizeMatrixNonsquare.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ReturnBadTypeFromMain.sksl Support half4 return values from main() in the SPIR-V code generator. 2021-01-27 02:46:03 +00:00
ReturnColorFromMain.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ReturnsValueOnEveryPathES2.sksl Revert "Enable various switch tests in ES2 mode." 2021-12-02 19:03:11 +00:00
ReturnsValueOnEveryPathES3.sksl Revert "Enable various switch tests in ES2 mode." 2021-12-02 19:03:11 +00:00
SampleLocations.vert
ScalarConversionConstructorsES2.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ScalarConversionConstructorsES3.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ScopedSymbol.sksl Match GLSL scoping rules more closely in SkSL. 2021-10-12 21:53:28 +00:00
StackingVectorCasts.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
StaticIf.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
StaticSwitch.sksl Enable additional SkSL tests which require non-ES2 features. 2021-05-17 20:24:50 +00:00
StaticSwitchWithBreak.sksl
StaticSwitchWithBreakInsideBlock.sksl
StaticSwitchWithConditionalBreak.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
StaticSwitchWithConditionalBreakInsideBlock.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
StaticSwitchWithContinue.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
StaticSwitchWithFallthroughA.sksl
StaticSwitchWithFallthroughB.sksl
StaticSwitchWithStaticConditionalBreak.sksl
StaticSwitchWithStaticConditionalBreakInsideBlock.sksl
StructArrayFollowedByScalar.sksl Demonstrate parsing error with structs and arrays. 2021-08-25 17:26:54 +00:00
StructMaxDepth.sksl Enforce basic limits on global size in SkSL. 2021-11-04 18:34:19 +00:00
Structs.sksl Roll SPIRV-Headers and SPIRV-Tools 2021-11-19 19:22:54 +00:00
StructsInFunctions.sksl Reland "Fix Metal codegen error with structs containing compound types." 2021-11-15 13:29:06 +00:00
Switch.sksl Re-re-reland "Rewrite switch statements in GLSL strict-ES2 mode." 2021-09-27 14:35:19 +00:00
SwitchDefaultOnly.sksl Re-re-reland "Rewrite switch statements in GLSL strict-ES2 mode." 2021-09-27 14:35:19 +00:00
SwitchWithFallthrough.sksl Re-re-reland "Rewrite switch statements in GLSL strict-ES2 mode." 2021-09-27 14:35:19 +00:00
SwitchWithLoops.sksl Re-re-reland "Rewrite switch statements in GLSL strict-ES2 mode." 2021-09-27 14:35:19 +00:00
SwizzleBoolConstants.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
SwizzleByConstantIndex.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
SwizzleByIndex.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
SwizzleConstants.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
SwizzleLTRB.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
SwizzleOpt.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
SwizzleScalar.sksl Add scalar-swizzling tests for int and bool types. 2021-07-12 19:54:40 +00:00
SwizzleScalarBool.sksl Add scalar-swizzling tests for int and bool types. 2021-07-12 19:54:40 +00:00
SwizzleScalarInt.sksl Add scalar-swizzling tests for int and bool types. 2021-07-12 19:54:40 +00:00
TernaryAsLValueEntirelyFoldable.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
TernaryAsLValueFoldableTest.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
TernaryExpression.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
Texture1D.sksl
Texture2D.sksl
TextureSharpen.sksl
UnaryPositiveNegative.sksl [sksl] Special-case unary negation on matrix types in MSL/SPIR-V 2022-03-01 20:14:46 +00:00
UniformArray.sksl Add SkSL test for uniform arrays. 2021-10-05 13:25:00 +00:00
UniformBuffers.sksl Add default uniform binding value for Metal/SPIR-V. 2021-01-28 19:23:49 +00:00
Uniforms.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
UnusedVariables.sksl Replace break with continue inside empty (post-optimization) loop. 2021-09-21 13:06:50 +00:00
VectorConstructors.sksl Remove usage of sqrt() as an optimization barrier in tests. 2021-05-24 17:18:54 +00:00
VectorScalarMath.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
VectorToMatrixCast.sksl Fix diagonal-matrix assertion discovered by fuzzer. 2021-08-23 17:33:42 +00:00
VertexID.vert
WhileLoopControlFlow.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00