xref: /aosp_15_r20/external/skia/tests/sksl/errors/InvalidAssignment.glsl (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1### Compilation failed:
2
3error: 11: cannot assign to this expression
4void assign_to_literal()                      { 1 = 2; }
5                                                ^
6error: 12: cannot modify immutable variable 'u'
7void assign_to_uniform()                      { u = 0; }
8                                                ^
9error: 13: cannot modify immutable variable 'x'
10void assign_to_const()                        { const int x = 1; x = 0; }
11                                                                 ^
12error: 15: cannot assign to this expression
13void assign_to_const_swizzle()                { const half4 x = half4(1); x.w = 0; }
14                                                                          ^^^
15error: 16: cannot write to the same swizzle field more than once
16void assign_to_repeated_swizzle()             { half4 x; x.yy = half2(0); }
17                                                         ^^^^
18error: 18: cannot modify immutable variable 'l'
19void assign_to_foldable_ternary_const_left()  { const float l = 1; float r; (true ? l : r) = 0; }
20                                                                            ^^^^^^^^^^^^^^
21error: 19: cannot modify immutable variable 'r'
22void assign_to_foldable_ternary_const_right() { float l; const float r = 1; (false ? l : r) = 0; }
23                                                                            ^^^^^^^^^^^^^^^
24error: 20: cannot modify immutable variable 'l'
25void assign_to_foldable_ternary_const_both()  { const float l = 1; const float r = 1; (true ? l : r) = 0; }
26                                                                                      ^^^^^^^^^^^^^^
27error: 21: cannot assign to this expression
28void assign_to_unfoldable_ternary()           { float l, r; (u > 0 ? l : r) = 0; }
29                                                            ^^^^^^^^^^^^^^^
30error: 22: cannot assign to this expression
31void assign_to_unary_minus()                  { float x; -x = 0; }
32                                                         ^^
33error: 25: cannot modify immutable variable 'x'
34void assign_to_const_param(const int x)             { x = 0; }
35                                                      ^
36error: 26: cannot modify immutable variable 'x'
37void assign_to_const_array_param(const int x[1])    { x[0] = 0; }
38                                                      ^
39error: 27: cannot modify immutable variable 's.f'
40void assign_to_const_struct_param(const S s)        { s.f = 0; }
41                                                      ^
42error: 28: cannot modify immutable variable 't.s'
43void assign_to_const_nested_struct_param(const T t) { t.s.f = 0; }
44                                                      ^
4514 errors
46