skia2/tests/sksl
John Stiles 830c69ca66 Implement operator== and != for Metal structs and arrays.
GLSL/SkSL assumes that == and != on struct/array types should work.
We need to emit equality and inequality operators whenever we find code
that compares a struct or array.

Structs and arrays can be arbitrarily nested, and either type can
contain a matrix. All of these things need custom equality operators in
Metal. Therefore, we need to recursively generate comparison operators
when any of these types are encountered.

For arrays we get lucky, and we can cover all possible array types and
sizes with a single templated operator== method. Structs and matrices
have no such luck, and are generated separately on a per-type basis.

For each of these types, operator== is implemented as an equality check
on each field, and operator!= is implemented in terms of operator==.
Equality and inequality are always emitted together. (Previously, matrix
equality and inequality were emitted and implemented independently, but
this is no longer the case.)

Change-Id: I69ee01c0a390d7db6bcb2253ed6336ab20cc4d1d
Bug: skia:11908, skia:11924
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402016
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-04-29 13:03:17 +00:00
..
blend Revert "Revert "Added more RelaxedPrecision decorations"" 2021-03-23 19:34:42 +00:00
dslfp Remove sample-with-matrix from SkSL 2021-04-28 15:44:35 +00:00
errors Simplify for init-stmts at the IR level. 2021-04-20 14:38:36 +00:00
folding Represent matrix resizes as a dedicated expression type. 2021-04-06 18:35:06 +00:00
fp Remove SkSL sample-with-matrix implementation 2021-04-29 12:46:57 +00:00
glsl Remove specific blend mode layout qualifiers 2021-02-23 15:45:55 +00:00
inliner Loosen ES3 restrictions in Runtime Effects for debugging. 2021-04-28 19:59:36 +00:00
intrinsics Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
metal Mangle function names in Metal. 2021-03-22 17:23:21 +00:00
runtime Remove sample-with-matrix from SkSL 2021-04-28 15:44:35 +00:00
runtime_errors Remove layout(marker) from runtime effect SkSL 2021-04-19 18:48:45 +00:00
shared Implement operator== and != for Metal structs and arrays. 2021-04-29 13:03:17 +00:00
spirv Represent vector-cast constructors with ConstructorVectorCast. 2021-04-05 16:28:06 +00:00
workarounds Rewrite matrix * vector multiplication on ARM GPUs. 2021-03-24 19:21:44 +00:00
README.txt Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00

This directory contains skslc-compiled output from matching source files
in the /resources/sksl/ directory.