2020-04-17 14:46:06 +00:00
|
|
|
static float4 FragColor;
|
|
|
|
|
|
|
|
struct SPIRV_Cross_Output
|
|
|
|
{
|
2020-04-21 09:41:33 +00:00
|
|
|
float4 FragColor : SV_Target0;
|
2020-04-17 14:46:06 +00:00
|
|
|
};
|
|
|
|
|
2020-11-23 14:42:27 +00:00
|
|
|
uint64_t spvPackUint2x32(uint2 value)
|
2020-04-17 14:46:06 +00:00
|
|
|
{
|
2020-04-21 09:48:37 +00:00
|
|
|
return (uint64_t(value.y) << 32) | uint64_t(value.x);
|
2020-04-17 14:46:06 +00:00
|
|
|
}
|
|
|
|
|
2020-11-23 14:42:27 +00:00
|
|
|
uint2 spvUnpackUint2x32(uint64_t value)
|
2020-04-17 14:46:06 +00:00
|
|
|
{
|
|
|
|
uint2 Unpacked;
|
|
|
|
Unpacked.x = uint(value & 0xffffffff);
|
|
|
|
Unpacked.y = uint(value >> 32);
|
2020-04-21 09:48:37 +00:00
|
|
|
return Unpacked;
|
2020-04-17 14:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void frag_main()
|
|
|
|
{
|
2020-11-23 14:42:27 +00:00
|
|
|
uint2 unpacked = spvUnpackUint2x32(spvPackUint2x32(uint2(18u, 52u)));
|
2020-04-17 14:46:06 +00:00
|
|
|
FragColor = float4(float(unpacked.x), float(unpacked.y), 1.0f, 1.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
SPIRV_Cross_Output main()
|
|
|
|
{
|
|
|
|
frag_main();
|
|
|
|
SPIRV_Cross_Output stage_output;
|
2020-04-21 09:41:33 +00:00
|
|
|
stage_output.FragColor = FragColor;
|
2020-04-17 14:46:06 +00:00
|
|
|
return stage_output;
|
|
|
|
}
|