aboutsummaryrefslogtreecommitdiff
path: root/resources/sksl/errors/VectorSlice.sksl
blob: 37bba65c82a014e1dd305f3ec3c15cf6bb64cb7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Expect 9 errors

// SkSL does not support shrinking a vector via casting.
// A vector-slice can be performed in SkSL (or GLSL) by using a swizzle instead.

const half4 h4 = half4(0);
const half3 h3 = half3(h4);
const half2 h2 = half2(h4);
const half  h  = half (h4);

const int4  i4 = int4(0);
const int3  i3 = int3(i4);
const int2  i2 = int2(i4);
const int   i  = int (i4);

const bool4 b4 = bool4(false);
const bool3 b3 = bool3(b4);
const bool2 b2 = bool2(b4);
const bool  b  = bool (b4);

/*%%*
'half4' is not a valid parameter to 'half3' constructor; use '.xyz' instead
'half4' is not a valid parameter to 'half2' constructor; use '.xy' instead
'half4' is not a valid parameter to 'half' constructor; use '.x' instead
'int4' is not a valid parameter to 'int3' constructor; use '.xyz' instead
'int4' is not a valid parameter to 'int2' constructor; use '.xy' instead
'int4' is not a valid parameter to 'int' constructor; use '.x' instead
'bool4' is not a valid parameter to 'bool3' constructor; use '.xyz' instead
'bool4' is not a valid parameter to 'bool2' constructor; use '.xy' instead
'bool4' is not a valid parameter to 'bool' constructor; use '.x' instead
*%%*/