• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1uniform half4 colorRed, colorGreen;
2
3struct S {
4    half i;
5    half j;
6};
7
8half4 main(float2 coords) {
9    // All of these assignments can be preserved.
10    half4 x = half4(3, 2, 1, 0);
11    x.xyz = x.zyx;
12
13    S s;
14    s.i = 2;
15    s.j = 2;
16    s.i = s.j;
17    s.j = s.i;
18
19    half a[2];
20    a[0] = 1;
21    a[1] = 0;
22    a[1] = a[0];
23
24    // All of these assignments should be eliminated.
25    x.wy = x.wy;
26    x.xyz = x.xyz;
27    x = x;
28    s.i = s.i;
29    s.j = s.j;
30    a[0] = a[0];
31    a[1] = a[1];
32
33    return half4(x.w, s.i / s.j, a[0] - a[1], a[0] * a[1]);
34}
35