glsl: Reject TCS/TES input arrays not sized to gl_MaxPatchVertices.
[mesa.git] / src / compiler / glsl / lower_named_interface_blocks.cpp
index 434cea90920a731077af5ec56e3ae74145b62be9..dbf0c639028f95c2b60fbaa9ca337e65b3efe9ce 100644 (file)
@@ -179,6 +179,13 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions)
             }
             new_var->data.location = iface_t->fields.structure[i].location;
             new_var->data.explicit_location = (new_var->data.location >= 0);
+            new_var->data.offset = iface_t->fields.structure[i].offset;
+            new_var->data.explicit_xfb_offset =
+               (iface_t->fields.structure[i].offset >= 0);
+            new_var->data.xfb_buffer =
+               iface_t->fields.structure[i].xfb_buffer;
+            new_var->data.explicit_xfb_buffer =
+               iface_t->fields.structure[i].explicit_xfb_buffer;
             new_var->data.interpolation =
                iface_t->fields.structure[i].interpolation;
             new_var->data.centroid = iface_t->fields.structure[i].centroid;
@@ -210,12 +217,23 @@ ir_visitor_status
 flatten_named_interface_blocks_declarations::visit_leave(ir_assignment *ir)
 {
    ir_dereference_record *lhs_rec = ir->lhs->as_dereference_record();
+
+   ir_variable *lhs_var =  ir->lhs->variable_referenced();
+   if (lhs_var && lhs_var->get_interface_type()) {
+      lhs_var->data.assigned = 1;
+   }
+
    if (lhs_rec) {
       ir_rvalue *lhs_rec_tmp = lhs_rec;
       handle_rvalue(&lhs_rec_tmp);
       if (lhs_rec_tmp != lhs_rec) {
          ir->set_lhs(lhs_rec_tmp);
       }
+
+      ir_variable *lhs_var =  lhs_rec_tmp->variable_referenced();
+      if (lhs_var) {
+         lhs_var->data.assigned = 1;
+      }
    }
    return rvalue_visit(ir);
 }
@@ -271,7 +289,7 @@ flatten_named_interface_blocks_declarations::handle_rvalue(ir_rvalue **rvalue)
 }
 
 void
-lower_named_interface_blocks(void *mem_ctx, gl_shader *shader)
+lower_named_interface_blocks(void *mem_ctx, gl_linked_shader *shader)
 {
    flatten_named_interface_blocks_declarations v_decl(mem_ctx);
    v_decl.run(shader->ir);