• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Expect 9 errors
2
3// SkSL does not support shrinking a vector via casting.
4// A vector-slice can be performed in SkSL (or GLSL) by using a swizzle instead.
5
6const half4 h4 = half4(0);
7const half3 h3 = half3(h4);
8const half2 h2 = half2(h4);
9const half  h  = half (h4);
10
11const int4  i4 = int4(0);
12const int3  i3 = int3(i4);
13const int2  i2 = int2(i4);
14const int   i  = int (i4);
15
16const bool4 b4 = bool4(false);
17const bool3 b3 = bool3(b4);
18const bool2 b2 = bool2(b4);
19const bool  b  = bool (b4);
20
21/*%%*
22'half4' is not a valid parameter to 'half3' constructor; use '.xyz' instead
23'half4' is not a valid parameter to 'half2' constructor; use '.xy' instead
24'half4' is not a valid parameter to 'half' constructor; use '.x' instead
25'int4' is not a valid parameter to 'int3' constructor; use '.xyz' instead
26'int4' is not a valid parameter to 'int2' constructor; use '.xy' instead
27'int4' is not a valid parameter to 'int' constructor; use '.x' instead
28'bool4' is not a valid parameter to 'bool3' constructor; use '.xyz' instead
29'bool4' is not a valid parameter to 'bool2' constructor; use '.xy' instead
30'bool4' is not a valid parameter to 'bool' constructor; use '.x' instead
31*%%*/
32