// Create a new variable to hold the return value of the inlined function.
r_result_name = get_unused_variable_name(staging_block, "_return");
unique_ptr<VariableDeclaration> var = make_unique<VariableDeclaration>();
- var->source = ret.source;
+ var->source = (ret.source==BUILTIN_SOURCE ? GENERATED_SOURCE : ret.source);
var->line = ret.line;
var->type = source_func->return_type;
var->name = r_result_name;
--- /dev/null
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 pos1;
+layout(location=1) in vec4 pos2;
+layout(location=2) in float weight;
+void main()
+{
+ vec4 p = mix(pos1, pos2, weight);
+ gl_Position = p+p;
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 pos1;
+layout(location=1) in vec4 pos2;
+layout(location=2) in float weight;
+void main()
+{
+ vec4 _return = mix(pos1, pos2, vec4(weight));
+ gl_Position = _return+_return;
+ gl_Position.z = gl_Position.z*2.0-gl_Position.w;
+}
+*/