skia2/tests/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 Use $ prefix on built-in private functions. 2022-01-25 15:21:42 +00:00
errors Report an error if an out param is never written to. 2022-01-26 21:42:13 +00:00
folding Implement constant folding for componentwise matrix-matrix ops. 2022-01-25 17:52:31 +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 Revert "[skslc] Generate .hlsl test output files" 2022-01-25 04:57:15 +00:00
metal Reland "Add support for half-precision types in Metal." 2021-10-30 14:33:52 +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 Remove old test outputs. 2022-01-25 22:42:56 +00:00
spirv Roll SPIRV-Headers and SPIRV-Tools 2021-11-19 19:22:54 +00:00
workarounds Use $ prefix on built-in private functions. 2022-01-25 15:21:42 +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.