• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2void Test1()
3{
4    struct mystruct { float2 a; };
5    mystruct test1 = {
6        { 1, 2, },          // test trailing commas in list
7    };
8
9    mystruct test2 = {
10        float2(3, 4),
11    };
12
13    // mystruct test3 = {
14    //     { { 5, 6, } },   // TODO: test unneeded levels
15    // };
16
17    float test4 = { 7, } ;   // test scalar initialization
18
19    struct mystruct2 { float a; float b; float c; };
20    mystruct2 test5 = { {8,}, {9,}, {10}, };
21    const mystruct2 constTest5 = { {8,}, {9,}, {10}, };
22    constTest5.c;
23
24    float const origStep = 1.0f;
25    const float step = origStep;
26    float n = 0;
27    const float3 a[8] = {
28            normalize(float3(1, 1, 1)) * (n += step),
29            normalize(float3(-1, -1, -1)) * (n += step),
30            normalize(float3(-1, -1, 1)) * (n += step),
31            normalize(float3(-1, 1, -1)) * (n += step),
32            normalize(float3(-1, 1, 1)) * (n += step),
33            normalize(float3(1, -1, -1)) * (n += step),
34            normalize(float3(1, -1, 1)) * (n += step),
35            normalize(float3(1, 1, -1)) * (n += step) };
36
37    const struct one { float3 a; } oneNonConst = { normalize(float3(-1, 1, 1)) * (n += step) };
38    const struct two { float3 a;
39                       float3 b; } twoNonConst = { normalize(float3(-1, 1, 1)) * (n += step),
40                                                   normalize(float3(-1, 1, 1)) * (n += step) };
41}
42
43struct PS_OUTPUT { float4 color : SV_Target0; };
44
45PS_OUTPUT main()
46{
47    Test1();
48
49    PS_OUTPUT ps_output;
50    ps_output.color = 1.0;
51    return ps_output;
52}
53