SPIRV-Cross/reference/shaders-msl/frag/16bit-constants.frag
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

22 lines
311 B
GLSL

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
half foo [[color(0)]];
short bar [[color(1)]];
ushort baz [[color(2)]];
};
fragment main0_out main0()
{
main0_out out = {};
out.foo = half(1.0);
out.bar = 2;
out.baz = 3u;
return out;
}