SPIRV-Cross/reference/shaders-msl-no-opt/asm/comp/bitcast-fp16-fp32.asm.comp
Hans-Kristian Arntzen 5e5d1c27ce GLSL: Support f16x2 <-> f32 bitcast.
There is no native formulation, so introduce a concept of a "complex"
bitcast to handle odd-ball cases which have no native unary operation.
2020-04-21 23:27:33 +02:00

22 lines
325 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct SSBO
{
half2 a;
float b;
float c;
half2 d;
};
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u);
kernel void main0(device SSBO& _4 [[buffer(0)]])
{
_4.b = as_type<float>(_4.a);
_4.d = as_type<half2>(_4.c);
}