| cbuffer _UniformBuffer : register(b0, space0) |
| { |
| uint _7_a : packoffset(c0); |
| }; |
| |
| |
| 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() |
| { |
| float2 _14 = spvUnpackHalf2x16(_7_a); |
| sk_FragColor = float4(_14.x, _14.y, sk_FragColor.z, sk_FragColor.w); |
| float2 _23 = spvUnpackUnorm2x16(_7_a); |
| sk_FragColor = float4(_23.x, _23.y, sk_FragColor.z, sk_FragColor.w); |
| float2 _28 = spvUnpackSnorm2x16(_7_a); |
| sk_FragColor = float4(_28.x, _28.y, sk_FragColor.z, sk_FragColor.w); |
| sk_FragColor = spvUnpackUnorm4x8(_7_a); |
| sk_FragColor = spvUnpackSnorm4x8(_7_a); |
| } |
| |
| SPIRV_Cross_Output main() |
| { |
| frag_main(); |
| SPIRV_Cross_Output stage_output; |
| stage_output.sk_FragColor = sk_FragColor; |
| return stage_output; |
| } |