361fe52c9d
MSL would force thread const& which would not work if the input argument came from a different storage class. Emit proper non-reference arguments for such values.
30 lines
448 B
GLSL
30 lines
448 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)]];
|
|
};
|
|
|
|
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;
|
|
}
|
|
|