}
if(ExpressionInliner().apply(stage))
{
- resolve(stage, RESOLVE_VARIABLES|RESOLVE_EXPRESSIONS);
+ resolve(stage, RESOLVE_VARIABLES|RESOLVE_FUNCTIONS|RESOLVE_EXPRESSIONS);
any_inlined = true;
}
--- /dev/null
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+layout(location=1) in vec2 scale;
+float square(float arg)
+{
+ return arg*arg;
+}
+void main()
+{
+ float x_sq = square(scale.x);
+ float y_sq = square(scale.y);
+ gl_Position = position*sqrt(x_sq+y_sq);
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 position;
+layout(location=1) in vec2 scale;
+float square(float arg)
+{
+ return arg*arg;
+}
+void main()
+{
+ gl_Position = position*sqrt(square(scale.x)+square(scale.y));
+}
+*/