SPIRV-Cross/reference/shaders-msl/comp/bitcast-16bit-1.invalid.comp
Hans-Kristian Arntzen 4ef51331b2 Always value-cast FP16 constants instead of using literals.
GL_NV_gpu_shader5 doesn't support "hf", so to avoid lots of complicated
workarounds, just value-cast the half literals.
2019-02-20 12:30:01 +01:00

25 lines
603 B
Plaintext

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct SSBO0
{
short4 inputs[1];
};
struct SSBO1
{
int4 outputs[1];
};
kernel void main0(device SSBO0& _25 [[buffer(0)]], device SSBO1& _39 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
{
uint ident = gl_GlobalInvocationID.x;
half2 a = as_type<half2>(_25.inputs[ident].xy);
_39.outputs[ident].x = int(as_type<uint>(a + half2(half(1.0))));
_39.outputs[ident].y = as_type<int>(_25.inputs[ident].zw);
_39.outputs[ident].z = int(as_type<uint>(ushort2(_25.inputs[ident].xy)));
}