SPIRV-Cross/reference/shaders/asm/frag/pass-by-value.asm.frag
Hans-Kristian Arntzen 361fe52c9d MSL: Properly support passing parameters by value.
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.
2018-08-06 15:43:51 +02:00

22 lines
247 B
GLSL

#version 450
struct Registers
{
float foo;
};
uniform Registers registers;
layout(location = 0) out float FragColor;
float add_value(float v, float w)
{
return v + w;
}
void main()
{
FragColor = add_value(10.0, registers.foo);
}