| 1 |
static const float _16[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f }; |
| 2 |
static const float4 _60[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx }; |
| 3 |
static const float4 _104[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx }; |
| 4 |
|
| 5 |
static float FragColor; |
| 6 |
static int index; |
| 7 |
|
| 8 |
struct SPIRV_Cross_Input |
| 9 |
{ |
| 10 |
nointerpolation int index : TEXCOORD0; |
| 11 |
}; |
| 12 |
|
| 13 |
struct SPIRV_Cross_Output |
| 14 |
{ |
| 15 |
float FragColor : SV_Target0; |
| 16 |
}; |
| 17 |
|
| 18 |
void frag_main() |
| 19 |
{ |
| 20 |
FragColor = _16[index]; |
| 21 |
if (index < 10) |
| 22 |
{ |
| 23 |
FragColor += _16[index ^ 1]; |
| 24 |
} |
| 25 |
else |
| 26 |
{ |
| 27 |
FragColor += _16[index & 1]; |
| 28 |
} |
| 29 |
if (index > 30) |
| 30 |
{ |
| 31 |
FragColor += _60[index & 3].y; |
| 32 |
} |
| 33 |
else |
| 34 |
{ |
| 35 |
FragColor += _60[index & 1].x; |
| 36 |
} |
| 37 |
float4 foobar[4] = _60; |
| 38 |
if (index > 30) |
| 39 |
{ |
| 40 |
foobar[1].z = 20.0f; |
| 41 |
} |
| 42 |
FragColor += foobar[index & 3].z; |
| 43 |
float4 baz[4] = _60; |
| 44 |
baz = _104; |
| 45 |
FragColor += baz[index & 3].z; |
| 46 |
} |
| 47 |
|
| 48 |
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) |
| 49 |
{ |
| 50 |
index = stage_input.index; |
| 51 |
frag_main(); |
| 52 |
SPIRV_Cross_Output stage_output; |
| 53 |
stage_output.FragColor = FragColor; |
| 54 |
return stage_output; |
| 55 |
} |