skia2/resources/sksl
John Stiles 343258fa0c Fix fuzzer-discovered error with sk_SecondaryFragColor in SPIR-V.
sk_SecondaryFragColor corresponds to an ES2-only concept
(gl_SecondaryFragColorEXT) and does not have any SPIR-V equivalent.

Two fixes were needed:
- sk_SecondaryFragColor shouldn't be in SPIR-V code at all. Report it as
  an error when it appears.
- We don't stop compilation when this error is reported, so we need to
  fix up the assertion that the fuzzer initially discovered.
  Specifically, the fuzzer found that the `sk_SecondaryFragColor`
  variable never got a SPIR-V ID assigned to it in fVariableMap, so the
  compiler would assert when assembling an expression containing that
  variable. Now, we make sure to populate fVariableMap with an (unused)
  ID in `writeGlobalVar` to avoid this crash.

Change-Id: Ib86919dfc9a325b2b82a7f4b2054b747dad7c32f
Bug: oss-fuzz:44096
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501976
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2022-01-31 16:21:45 +00:00
..
blend Remove SkBlendMode from SkSL 2021-06-16 21:01:30 +00:00
errors Fix fuzzer-discovered error with sk_SecondaryFragColor in SPIR-V. 2022-01-31 16:21:45 +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
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.