--- /dev/null
+uniform sampler2D tex;
+uniform Transform
+{
+ mat4 model_matrix;
+ mat4 vp_matrix;
+};
+uniform Lighting
+{
+ vec3 light_dir;
+ vec3 light_color;
+};
+
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+layout(location=1) in vec3 normal;
+layout(location=2) in vec2 texcoord;
+void main()
+{
+ passthrough;
+ out vec3 world_normal = mat3(model_matrix)*normal;
+ gl_Position = vp_matrix*model_matrix*position;
+}
+
+#pragma MSP stage(fragment)
+layout(location=0) out vec4 frag_color;
+void main()
+{
+ frag_color = texture(tex, texcoord);
+ frag_color.rgb *= max(dot(normalize(world_normal), light_dir), 0.0)*light_color;
+}
+
+/* Expected output: vertex
+layout(binding=48) uniform Transform
+{
+ mat4 model_matrix;
+ mat4 vp_matrix;
+};
+layout(location=0) in vec4 position;
+layout(location=1) in vec3 normal;
+layout(location=2) in vec2 texcoord;
+layout(location=0) out vec2 _vs_out_texcoord;
+layout(location=1) out vec3 world_normal;
+void main()
+{
+ _vs_out_texcoord = texcoord;
+ mat4 _temp = model_matrix;
+ world_normal = mat3(_temp[0].xyz, _temp[1].xyz, _temp[2].xyz)*normal;
+ gl_Position = vp_matrix*model_matrix*position;
+}
+*/
+
+/* Expected output: fragment
+layout(location=0, binding=71) uniform sampler2D tex;
+layout(binding=5) uniform Lighting
+{
+ vec3 light_dir;
+ vec3 light_color;
+};
+layout(location=0) out vec4 frag_color;
+layout(location=0) in vec2 _vs_out_texcoord;
+layout(location=1) in vec3 world_normal;
+void main()
+{
+ frag_color = texture(tex, _vs_out_texcoord);
+ frag_color.rgb *= max(dot(normalize(world_normal), light_dir), 0.0)*light_color;
+}
+*/