skia2/resources/sksl
John Stiles f4103618ff Report an error if an out param is never written to.
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>
2022-01-26 21:42:13 +00:00
..
blend Remove SkBlendMode from SkSL 2021-06-16 21:01:30 +00:00
errors Report an error if an out param is never written to. 2022-01-26 21:42:13 +00:00
es2_conformance Mark symbols starting with gl_ as reserved words. 2021-11-01 22:43:44 +00:00
folding Add matrix-op-matrix tests to MatrixFoldingES2. 2022-01-25 17:52:27 +00:00
glsl Report an error if sk_LastFragColor is referenced without fbFetchSupport 2021-09-15 15:41:49 +00:00
inliner Fix up test SkSLInlineWithInoutArgument. 2022-01-25 21:33:45 +00:00
intrinsics Rename SkSL's 2D cross product builtin function 2021-12-14 22:00:26 +00:00
metal Reland "Restrict where 'binding' and 'set' can appear" 2021-11-23 18:03:24 +00:00
runtime Report an error if an out param is never written to. 2022-01-26 21:42:13 +00:00
runtime_errors Update comments in FirstClassArrays test. 2022-01-06 18:53:34 +00:00
shared Fix up test SkSLInlineWithInoutArgument. 2022-01-25 21:33:45 +00:00
spirv Disallow 'binding' and 'set' on push constants 2021-11-24 19:27:14 +00:00
workarounds Remove the "in blend modes randomly fail for all zero vec" workaround 2021-10-21 16:54:51 +00:00
README.txt Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
update_fuzzer.py Implement parser for ES2 conformance '.test' files. 2021-09-29 16:48:14 +00:00

This directory contains source files for testing skslc compilation.
The compiled output files are in the /tests/sksl/ directory.