2016-07-30 16:38:55 +03:00
|
|
|
|
|
|
|
void Test1()
|
|
|
|
{
|
|
|
|
struct mystruct { float2 a; };
|
|
|
|
mystruct test1 = {
|
2016-07-30 19:36:09 +03:00
|
|
|
{ 1, 2, }, // test trailing commas in list
|
2016-07-30 16:38:55 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
mystruct test2 = {
|
2016-07-30 19:36:09 +03:00
|
|
|
float2(3, 4),
|
2016-07-30 16:38:55 +03:00
|
|
|
};
|
|
|
|
|
2016-07-30 19:36:09 +03:00
|
|
|
// mystruct test3 = {
|
|
|
|
// { { 5, 6, } }, // TODO: test unneeded levels
|
|
|
|
// };
|
|
|
|
|
|
|
|
float test4 = { 7, } ; // test scalar initialization
|
|
|
|
|
|
|
|
struct mystruct2 { float a; float b; float c; };
|
|
|
|
mystruct2 test5 = { {8,}, {9,}, {10}, };
|
2017-01-05 20:28:26 +03:00
|
|
|
const mystruct2 constTest5 = { {8,}, {9,}, {10}, };
|
|
|
|
constTest5.c;
|
|
|
|
|
|
|
|
const float step = 1.f;
|
|
|
|
float n = 0;
|
|
|
|
const float3 a[8] = {
|
|
|
|
normalize(float3(1, 1, 1)) * (n += step),
|
|
|
|
normalize(float3(-1, -1, -1)) * (n += step),
|
|
|
|
normalize(float3(-1, -1, 1)) * (n += step),
|
|
|
|
normalize(float3(-1, 1, -1)) * (n += step),
|
|
|
|
normalize(float3(-1, 1, 1)) * (n += step),
|
|
|
|
normalize(float3(1, -1, -1)) * (n += step),
|
|
|
|
normalize(float3(1, -1, 1)) * (n += step),
|
|
|
|
normalize(float3(1, 1, -1)) * (n += step) };
|
|
|
|
|
|
|
|
const struct one { float3 a; } oneNonConst = { normalize(float3(-1, 1, 1)) * (n += step) };
|
|
|
|
const struct two { float3 a;
|
|
|
|
float3 b; } twoNonConst = { normalize(float3(-1, 1, 1)) * (n += step),
|
|
|
|
normalize(float3(-1, 1, 1)) * (n += step) };
|
2016-07-30 16:38:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
struct PS_OUTPUT { float4 color : SV_Target0; };
|
|
|
|
|
|
|
|
PS_OUTPUT main()
|
|
|
|
{
|
2016-07-30 19:36:09 +03:00
|
|
|
Test1();
|
|
|
|
|
2016-07-30 16:38:55 +03:00
|
|
|
PS_OUTPUT ps_output;
|
|
|
|
ps_output.color = 1.0;
|
|
|
|
return ps_output;
|
|
|
|
}
|