2017-08-09 15:05:51 +00:00
|
|
|
struct B
|
|
|
|
{
|
|
|
|
float a;
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
2018-02-02 09:10:17 +00:00
|
|
|
static const B _80 = { 10.0f, 20.0f };
|
|
|
|
|
2018-10-22 07:50:04 +00:00
|
|
|
cbuffer UBO : register(b0)
|
2017-08-09 15:05:51 +00:00
|
|
|
{
|
2018-01-09 09:40:34 +00:00
|
|
|
int _42_some_value : packoffset(c0);
|
2017-08-09 15:05:51 +00:00
|
|
|
};
|
|
|
|
|
2018-10-22 07:50:04 +00:00
|
|
|
|
2017-08-09 15:05:51 +00:00
|
|
|
void partial_inout(inout float4 x)
|
|
|
|
{
|
|
|
|
x.x = 10.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
void complete_inout(out float4 x)
|
|
|
|
{
|
2018-01-04 12:16:56 +00:00
|
|
|
x = 50.0f.xxxx;
|
2017-08-09 15:05:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void branchy_inout(inout float4 v)
|
|
|
|
{
|
|
|
|
v.y = 20.0f;
|
2018-01-09 09:40:34 +00:00
|
|
|
if (_42_some_value == 20)
|
2017-08-09 15:05:51 +00:00
|
|
|
{
|
2018-01-04 12:16:56 +00:00
|
|
|
v = 50.0f.xxxx;
|
2017-08-09 15:05:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void branchy_inout_2(out float4 v)
|
|
|
|
{
|
2018-01-09 09:40:34 +00:00
|
|
|
if (_42_some_value == 20)
|
2017-08-09 15:05:51 +00:00
|
|
|
{
|
2018-01-04 12:16:56 +00:00
|
|
|
v = 50.0f.xxxx;
|
2017-08-09 15:05:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-01-04 12:16:56 +00:00
|
|
|
v = 70.0f.xxxx;
|
2017-08-09 15:05:51 +00:00
|
|
|
}
|
|
|
|
v.y = 20.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
void partial_inout(inout B b)
|
|
|
|
{
|
|
|
|
b.b = 40.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
void frag_main()
|
|
|
|
{
|
2018-01-04 12:16:56 +00:00
|
|
|
float4 a = 10.0f.xxxx;
|
2017-08-09 15:05:51 +00:00
|
|
|
float4 param = a;
|
|
|
|
partial_inout(param);
|
|
|
|
a = param;
|
|
|
|
float4 param_1;
|
|
|
|
complete_inout(param_1);
|
|
|
|
a = param_1;
|
|
|
|
float4 param_2 = a;
|
|
|
|
branchy_inout(param_2);
|
|
|
|
a = param_2;
|
|
|
|
float4 param_3;
|
|
|
|
branchy_inout_2(param_3);
|
|
|
|
a = param_3;
|
2018-02-02 09:10:17 +00:00
|
|
|
B b = _80;
|
2017-08-09 15:05:51 +00:00
|
|
|
B param_4 = b;
|
|
|
|
partial_inout(param_4);
|
|
|
|
b = param_4;
|
|
|
|
}
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
frag_main();
|
|
|
|
}
|