#version 460
#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require
#extension GL_EXT_shader_16bit_storage : require
#if defined(GL_AMD_gpu_shader_half_float)
#extension GL_AMD_gpu_shader_half_float : require
#elif defined(GL_EXT_shader_explicit_arithmetic_types_float16)
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require
#else
#error No extension available for FP16.
#endif
layout(local_size_x = 2, local_size_y = 1, local_size_z = 1) in;

layout(set = 0, binding = 0, std430) readonly buffer SSBO
{
    u16vec4 _m0[];
} _10;

layout(set = 0, binding = 1, std430) writeonly buffer _12_14
{
    u16vec4 _m0[];
} _14;

void main()
{
    f16vec4 _28 = uint16BitsToFloat16(_10._m0[gl_GlobalInvocationID.x]);
    _14._m0[gl_GlobalInvocationID.x] = u16vec4(float16BitsToUint16(_28.x), float16BitsToUint16(_28.y), float16BitsToUint16(_28.z), float16BitsToUint16(_28.w));
}


#if 0
// SPIR-V disassembly
; SPIR-V
; Version: 1.3
; Generator: Unknown(30017); 21022
; Bound: 41
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability Int16
OpCapability StorageBuffer16BitAccess
OpCapability DenormPreserve
OpExtension "SPV_KHR_float_controls"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %3 "main" %18
OpExecutionMode %3 LocalSize 2 1 1
OpExecutionMode %3 DenormPreserve 16
OpName %3 "main"
OpName %8 "SSBO"
OpName %12 "SSBO"
OpDecorate %7 ArrayStride 8
OpMemberDecorate %8 0 Offset 0
OpDecorate %8 Block
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %10 NonWritable
OpDecorate %11 ArrayStride 8
OpMemberDecorate %12 0 Offset 0
OpDecorate %12 Block
OpDecorate %14 DescriptorSet 0
OpDecorate %14 Binding 1
OpDecorate %14 NonReadable
OpDecorate %18 BuiltIn GlobalInvocationId
%1 = OpTypeVoid
%2 = OpTypeFunction %1
%5 = OpTypeInt 16 0
%6 = OpTypeVector %5 4
%7 = OpTypeRuntimeArray %6
%8 = OpTypeStruct %7
%9 = OpTypePointer StorageBuffer %8
%10 = OpVariable %9 StorageBuffer
%11 = OpTypeRuntimeArray %6
%12 = OpTypeStruct %11
%13 = OpTypePointer StorageBuffer %12
%14 = OpVariable %13 StorageBuffer
%15 = OpTypeInt 32 0
%16 = OpTypeVector %15 3
%17 = OpTypePointer Input %16
%18 = OpVariable %17 Input
%19 = OpTypePointer Input %15
%21 = OpConstant %15 0
%23 = OpTypePointer StorageBuffer %6
%26 = OpTypeFloat 16
%27 = OpTypeVector %26 4
%3 = OpFunction %1 None %2
%4 = OpLabel
OpBranch %39
%39 = OpLabel
%20 = OpAccessChain %19 %18 %21
%22 = OpLoad %15 %20
%24 = OpAccessChain %23 %10 %21 %22
%25 = OpLoad %6 %24
%28 = OpBitcast %27 %25
%29 = OpCompositeExtract %26 %28 0
%30 = OpCompositeExtract %26 %28 1
%31 = OpCompositeExtract %26 %28 2
%32 = OpCompositeExtract %26 %28 3
%33 = OpBitcast %5 %29
%34 = OpBitcast %5 %30
%35 = OpBitcast %5 %31
%36 = OpBitcast %5 %32
%37 = OpCompositeConstruct %6 %33 %34 %35 %36
%38 = OpAccessChain %23 %14 %21 %22
OpStore %38 %37
OpReturn
OpFunctionEnd
#endif
