John Kessenich | 4e55988 | 2016-09-27 23:09:32 -0600 | [diff] [blame] | 1 | static float4 a1 = float4(1, 0.5, 0, 1), b1 = float4(2.0, 2.5, 2.1, 2.2); |
| 2 | static float4 a1i = {1, 0.5, 0, 1}, b1i = {2.0, 2.5, 2.1, 2.2}; |
| 3 | static float a2 = 0.2, b2; |
| 4 | static float a3, b3 = 0.3; |
| 5 | static float a4, b4 = 0.4, c4; |
| 6 | static float a5 = 0.5, b5, c5 = 1.5; |
John Kessenich | ff13213 | 2016-07-29 18:22:22 -0600 | [diff] [blame] | 7 |
|
| 8 | struct Single1 { int f; };
|
John Kessenich | 4e55988 | 2016-09-27 23:09:32 -0600 | [diff] [blame] | 9 | static Single1 single1 = { 10 };
|
John Kessenich | ff13213 | 2016-07-29 18:22:22 -0600 | [diff] [blame] | 10 |
|
| 11 | struct Single2 { uint2 v; };
|
John Kessenich | 4e55988 | 2016-09-27 23:09:32 -0600 | [diff] [blame] | 12 | static Single2 single2 = { { 1, 2 } };
|
John Kessenich | ff13213 | 2016-07-29 18:22:22 -0600 | [diff] [blame] | 13 |
|
| 14 | struct Single3 { Single1 s1; };
|
John Kessenich | 4e55988 | 2016-09-27 23:09:32 -0600 | [diff] [blame] | 15 | static Single3 single3 = { { 3 } };
|
John Kessenich | ff13213 | 2016-07-29 18:22:22 -0600 | [diff] [blame] | 16 |
|
| 17 | struct Single4 { Single2 s1; };
|
John Kessenich | 4e55988 | 2016-09-27 23:09:32 -0600 | [diff] [blame] | 18 | static Single4 single4 = { { { 4u, 5u } } };
|
John Kessenich | 532543c | 2016-07-01 19:06:44 -0600 | [diff] [blame] | 19 | |
| 20 | float4 ShaderFunction(float4 input) : COLOR0 |
| 21 | { |
| 22 | float4 a2 = float4(0.2, 0.3, 0.4, 0.5); |
John Kessenich | 0735424 | 2016-07-01 19:58:06 -0600 | [diff] [blame] | 23 | struct S1 { |
| 24 | float f; |
| 25 | int i; |
| 26 | }; |
| 27 | struct S2 { |
| 28 | int j; |
| 29 | float g; |
| 30 | S1 s1; |
| 31 | }; |
| 32 | S2 s2i = { 9, a5, { (a3,a4), 12} }, s2 = S2(9, a5, S1((a3,a4), 12)); |
| 33 | float a8 = (a2, b2), a9 = a5; |
John Kessenich | 532543c | 2016-07-01 19:06:44 -0600 | [diff] [blame] | 34 | |
| 35 | return input * a1; |
| 36 | } |
John Kessenich | 18adbdb | 2017-02-02 15:16:20 -0700 | [diff] [blame] | 37 | |
| 38 | cbuffer Constants
|
| 39 | {
|
| 40 | float a = 1.0f, b, c = 2.0f;
|
| 41 | };
|