SPIRV-Cross/reference/shaders-msl/asm/frag/pass-by-value.asm.frag
2019-09-24 14:35:25 -04:00

31 lines
493 B
GLSL

#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Registers
{
float foo;
};
struct main0_out
{
float FragColor [[color(0)]];
};
static inline __attribute__((always_inline))
float add_value(float v, float w)
{
return v + w;
}
fragment main0_out main0(constant Registers& registers [[buffer(0)]])
{
main0_out out = {};
out.FragColor = add_value(10.0, registers.foo);
return out;
}