skia2/resources/sksl
John Stiles 33fb008669 Add parser support for u suffix on literals.
Because SkSL is much more permissive than GLSL about literal types, we
don't actually need to treat values any differently when the `u` suffix
is added. That is, `uint x = 4000000000;` already worked fine. When we
encounter the `u`, we just ignore it. This also means that a literal
like `-100u` would be accepted without complaint (although you'd get a
range error if you tried `uint x = -100u;`).

The value-add here is that it removes a speed bump when porting GLSL
code to SkSL. The Filament example shader used the `u` suffix anywhere
that bitwise ops were present; finding and removing all of them was a
chore.

Also of note: the `u` suffix was only added to GLSL in ES3, but we
"support" it everywhere. (We could go out of our way to detect it in
ES2 and flag an error, but that benefits no one.)

Change-Id: I4bf643612c8cf17710e9bad50a0c16f5936bbe88
Bug: skia:12634
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471756
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-11-16 13:50:14 +00:00
..
blend Remove SkBlendMode from SkSL 2021-06-16 21:01:30 +00:00
errors Add basic unit test for octal parsing support. 2021-11-16 13:49:41 +00:00
es2_conformance Mark symbols starting with gl_ as reserved words. 2021-11-01 22:43:44 +00:00
folding Replace getConstantSubexpression with getConstantValue. 2021-11-15 14:46:21 +00:00
glsl Report an error if sk_LastFragColor is referenced without fbFetchSupport 2021-09-15 15:41:49 +00:00
inliner Allow inlining of functions with unassigned out-params. 2021-11-11 19:33:06 +00:00
intrinsics Add support for clamp($genUType, ...) in SkSL. 2021-11-11 18:43:42 +00:00
metal Enable proper testing of matrix-scalar ops. 2021-05-17 17:36:22 +00:00
runtime Add variable slot information to SkVMDebugInfo. 2021-11-15 14:24:08 +00:00
runtime_errors Report incomplete expression-statements as errors. 2021-11-09 22:10:18 +00:00
shared Add parser support for u suffix on literals. 2021-11-16 13:50:14 +00:00
spirv Fix parsing error with SPIR-V negating a uint. 2021-08-25 17:52:50 +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.