blob: 8fe21b66b8ae578281a81f7830848d8642a42dcc [file] [log] [blame]
cbuffer _UniformBuffer : register(b0, space0)
{
float2 _7_a : packoffset(c0);
float4 _7_b : packoffset(c1);
};
static float4 sk_FragColor;
struct SPIRV_Cross_Output
{
float4 sk_FragColor : SV_Target0;
};
uint spvPackHalf2x16(float2 value)
{
uint2 Packed = f32tof16(value);
return Packed.x | (Packed.y << 16);
}
float2 spvUnpackHalf2x16(uint value)
{
return f16tof32(uint2(value & 0xffff, value >> 16));
}
uint spvPackUnorm4x8(float4 value)
{
uint4 Packed = uint4(round(saturate(value) * 255.0));
return Packed.x | (Packed.y << 8) | (Packed.z << 16) | (Packed.w << 24);
}
float4 spvUnpackUnorm4x8(uint value)
{
uint4 Packed = uint4(value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, value >> 24);
return float4(Packed) / 255.0;
}
uint spvPackSnorm4x8(float4 value)
{
int4 Packed = int4(round(clamp(value, -1.0, 1.0) * 127.0)) & 0xff;
return uint(Packed.x | (Packed.y << 8) | (Packed.z << 16) | (Packed.w << 24));
}
float4 spvUnpackSnorm4x8(uint value)
{
int SignedValue = int(value);
int4 Packed = int4(SignedValue << 24, SignedValue << 16, SignedValue << 8, SignedValue) >> 24;
return clamp(float4(Packed) / 127.0, -1.0, 1.0);
}
uint spvPackUnorm2x16(float2 value)
{
uint2 Packed = uint2(round(saturate(value) * 65535.0));
return Packed.x | (Packed.y << 16);
}
float2 spvUnpackUnorm2x16(uint value)
{
uint2 Packed = uint2(value & 0xffff, value >> 16);
return float2(Packed) / 65535.0;
}
uint spvPackSnorm2x16(float2 value)
{
int2 Packed = int2(round(clamp(value, -1.0, 1.0) * 32767.0)) & 0xffff;
return uint(Packed.x | (Packed.y << 16));
}
float2 spvUnpackSnorm2x16(uint value)
{
int SignedValue = int(value);
int2 Packed = int2(SignedValue << 16, SignedValue) >> 16;
return clamp(float2(Packed) / 32767.0, -1.0, 1.0);
}
void frag_main()
{
sk_FragColor.x = float(spvPackHalf2x16(_7_a));
sk_FragColor.x = float(spvPackUnorm2x16(_7_a));
sk_FragColor.x = float(spvPackSnorm2x16(_7_a));
sk_FragColor.x = float(spvPackUnorm4x8(_7_b));
sk_FragColor.x = float(spvPackSnorm4x8(_7_b));
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.sk_FragColor = sk_FragColor;
return stage_output;
}