r_constant_result = false;
if(composite_access)
{
- r_composite_base = var.declaration;
r_expression_result_id = 0;
+ if(!assignment_source_id)
+ {
+ auto i = variable_load_ids.find(var.declaration);
+ if(i!=variable_load_ids.end())
+ r_expression_result_id = i->second;
+ }
+ if(!r_expression_result_id)
+ r_composite_base = var.declaration;
}
else if(assignment_source_id)
{
--- /dev/null
+uniform Colors
+{
+ vec4 top_color;
+ vec4 bottom_color;
+};
+
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+layout(location=1) in vec3 normal;
+void main()
+{
+ gl_Position = position;
+ passthrough;
+}
+
+#pragma MSP stage(fragment)
+layout(location=0) out vec4 frag_color;
+vec4 get_color(vec3 n)
+{
+ if(n.z>=0)
+ return top_color;
+ else
+ return bottom_color;
+}
+void main()
+{
+ frag_color = get_color(normal);
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 position;
+layout(location=1) in vec3 normal;
+layout(location=0) out vec3 _vs_out_normal;
+void main()
+{
+ gl_Position = position;
+ _vs_out_normal = normal;
+}
+*/
+
+/* Expected output: fragment
+layout(binding=23) uniform Colors
+{
+ vec4 top_color;
+ vec4 bottom_color;
+};
+layout(location=0) out vec4 frag_color;
+vec4 get_color(vec3 n)
+{
+ if(n.z>=0.0)
+ return top_color;
+ else
+ return bottom_color;
+}
+layout(location=0) in vec3 _vs_out_normal;
+void main()
+{
+ frag_color = get_color(_vs_out_normal);
+}
+*/