skia2/resources/sksl/runtime_errors
Brian Osman 7b361499c9 Align SkSL const rules more closely with GLSL
This adds Analysis::IsConstantExpression, to determine if an expression
is a constant-expression. It now expands to cover 'const' local and
global variables, because we also enforce that the initializer on those
variables is - in turn - a constant expression.

This fixes 10837 - previously you could initialize a const variable with
a non-constant expression, and we'd emit GLSL that contained that same
pattern, which would fail to compile at the driver level. That should
not be possible any longer.

Bug: skia:10679
Bug: skia:10837
Change-Id: I517820ef4da57fff45768c0b04c55aebc18d3272
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/375856
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-26 17:44:11 +00:00
..
FirstClassArrays.rte Reject array-typed vardecls and array ctors in strict ES2 mode. 2021-02-04 19:36:50 +00:00
IllegalArrayOps.rte Runtime Effects: Disallow all operators on arrays or arrays-in-structs 2021-02-17 18:05:04 +00:00
IllegalIndexing.rte Align SkSL const rules more closely with GLSL 2021-02-26 17:44:11 +00:00
IllegalOperators.rte Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
IllegalStatements.rte Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
LoopConditionErrors.rte Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
LoopExpressionErrors.rte Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
LoopInitializerErrors.rte Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
LoopStructureErrors.rte Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
UnsupportedTypeSampler.rte Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00
UnsupportedTypeTexture.rte Migrate SkSL test inputs to the resources/ directory. 2021-01-22 18:57:29 +00:00