5e5d1c27ce
There is no native formulation, so introduce a concept of a "complex" bitcast to handle odd-ball cases which have no native unary operation.
26 lines
636 B
Plaintext
26 lines
636 B
Plaintext
#version 450
|
|
#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
|
|
#extension GL_EXT_shader_16bit_storage : require
|
|
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
|
|
|
|
layout(set = 0, binding = 0, std430) buffer SSBO
|
|
{
|
|
f16vec2 a;
|
|
float b;
|
|
float c;
|
|
f16vec2 d;
|
|
} _4;
|
|
|
|
void main()
|
|
{
|
|
_4.b = uintBitsToFloat(packFloat2x16(_4.a));
|
|
_4.d = unpackFloat2x16(floatBitsToUint(_4.c));
|
|
}
|
|
|