| 1 |
static float4 A; |
| 2 |
static float4 B; |
| 3 |
static float4 FragColor; |
| 4 |
|
| 5 |
struct SPIRV_Cross_Input |
| 6 |
{ |
| 7 |
float4 A : TEXCOORD0; |
| 8 |
float4 B : TEXCOORD1; |
| 9 |
}; |
| 10 |
|
| 11 |
struct SPIRV_Cross_Output |
| 12 |
{ |
| 13 |
float4 FragColor : SV_Target0; |
| 14 |
}; |
| 15 |
|
| 16 |
float4 test_vector() |
| 17 |
{ |
| 18 |
bool4 le = bool4(!(A.x >= B.x), !(A.y >= B.y), !(A.z >= B.z), !(A.w >= B.w)); |
| 19 |
bool4 leq = bool4(!(A.x > B.x), !(A.y > B.y), !(A.z > B.z), !(A.w > B.w)); |
| 20 |
bool4 ge = bool4(!(A.x <= B.x), !(A.y <= B.y), !(A.z <= B.z), !(A.w <= B.w)); |
| 21 |
bool4 geq = bool4(!(A.x < B.x), !(A.y < B.y), !(A.z < B.z), !(A.w < B.w)); |
| 22 |
bool4 eq = bool4(A.x == B.x, A.y == B.y, A.z == B.z, A.w == B.w); |
| 23 |
bool4 neq = bool4(A.x != B.x, A.y != B.y, A.z != B.z, A.w != B.w); |
| 24 |
return ((((float4(le.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, le.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, le.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, le.w ? 1.0f.xxxx.w : 0.0f.xxxx.w) + float4(leq.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, leq.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, leq.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, leq.w ? 1.0f.xxxx.w : 0.0f.xxxx.w)) + float4(ge.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, ge.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, ge.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, ge.w ? 1.0f.xxxx.w : 0.0f.xxxx.w)) + float4(geq.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, geq.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, geq.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, geq.w ? 1.0f.xxxx.w : 0.0f.xxxx.w)) + float4(eq.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, eq.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, eq.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, eq.w ? 1.0f.xxxx.w : 0.0f.xxxx.w)) + float4(neq.x ? 1.0f.xxxx.x : 0.0f.xxxx.x, neq.y ? 1.0f.xxxx.y : 0.0f.xxxx.y, neq.z ? 1.0f.xxxx.z : 0.0f.xxxx.z, neq.w ? 1.0f.xxxx.w : 0.0f.xxxx.w); |
| 25 |
} |
| 26 |
|
| 27 |
float test_scalar() |
| 28 |
{ |
| 29 |
bool le = !(A.x >= B.x); |
| 30 |
bool leq = !(A.x > B.x); |
| 31 |
bool ge = !(A.x <= B.x); |
| 32 |
bool geq = !(A.x < B.x); |
| 33 |
bool eq = A.x == B.x; |
| 34 |
bool neq = A.x != B.x; |
| 35 |
return ((((float(le) + float(leq)) + float(ge)) + float(geq)) + float(eq)) + float(neq); |
| 36 |
} |
| 37 |
|
| 38 |
void frag_main() |
| 39 |
{ |
| 40 |
FragColor = test_vector() + test_scalar().xxxx; |
| 41 |
} |
| 42 |
|
| 43 |
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) |
| 44 |
{ |
| 45 |
A = stage_input.A; |
| 46 |
B = stage_input.B; |
| 47 |
frag_main(); |
| 48 |
SPIRV_Cross_Output stage_output; |
| 49 |
stage_output.FragColor = FragColor; |
| 50 |
return stage_output; |
| 51 |
} |