Merge branch 'draw-instanced'
[mesa.git] / src / glsl / ir.h
index 8023a78dc2769119393895a7af11da0efa453de7..7b83c2836ee92e257dbfc703e1c060a39985d437 100644 (file)
@@ -122,6 +122,7 @@ public:
    virtual class ir_if *                as_if()               { return NULL; }
    virtual class ir_swizzle *           as_swizzle()          { return NULL; }
    virtual class ir_constant *          as_constant()         { return NULL; }
+   virtual class ir_discard *           as_discard()          { return NULL; }
    /*@}*/
 
 protected:
@@ -294,6 +295,15 @@ public:
    unsigned centroid:1;
    unsigned invariant:1;
 
+   /**
+    * Has this variable been used for reading or writing?
+    *
+    * Several GLSL semantic checks require knowledge of whether or not a
+    * variable has been used.  For example, it is an error to redeclare a
+    * variable as invariant after it has been used.
+    */
+   unsigned used:1;
+
    /**
     * Storage class of the variable.
     *
@@ -376,6 +386,8 @@ public:
 
    virtual ir_function_signature *clone(void *mem_ctx,
                                        struct hash_table *ht) const;
+   ir_function_signature *clone_prototype(void *mem_ctx,
+                                         struct hash_table *ht) const;
 
    virtual void accept(ir_visitor *v)
    {
@@ -842,12 +854,14 @@ public:
     * Constructor for unary operation expressions
     */
    ir_expression(int op, const struct glsl_type *type, ir_rvalue *);
+   ir_expression(int op, ir_rvalue *);
 
    /**
     * Constructor for binary operation expressions
     */
    ir_expression(int op, const struct glsl_type *type,
                 ir_rvalue *, ir_rvalue *);
+   ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1);
 
    /**
     * Constructor for quad operator expressions
@@ -1123,6 +1137,11 @@ public:
 
    virtual ir_visitor_status accept(ir_hierarchical_visitor *);
 
+   virtual ir_discard *as_discard()
+   {
+      return this;
+   }
+
    ir_rvalue *condition;
 };
 /*@}*/
@@ -1573,8 +1592,7 @@ _mesa_glsl_initialize_variables(exec_list *instructions,
                                struct _mesa_glsl_parse_state *state);
 
 extern void
-_mesa_glsl_initialize_functions(exec_list *instructions,
-                               struct _mesa_glsl_parse_state *state);
+_mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state);
 
 extern void
 _mesa_glsl_release_functions(void);