class ir_instruction : public exec_node {
public:
enum ir_node_type ir_type;
- const struct glsl_type *type;
/** ir_print_visitor helper for debugging. */
void print(void) const;
ir_instruction()
{
ir_type = ir_type_unset;
- type = NULL;
}
};
*/
class ir_rvalue : public ir_instruction {
public:
+ const struct glsl_type *type;
+
virtual ir_rvalue *clone(void *mem_ctx, struct hash_table *) const;
virtual void accept(ir_visitor *v)
*/
glsl_interp_qualifier determine_interpolation_mode(bool flat_shade);
+ /**
+ * Declared type of the variable
+ */
+ const struct glsl_type *type;
+
/**
* Delcared name of the variable
*/
* 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.
+ *
+ * This is only maintained in the ast_to_hir.cpp path, not in
+ * Mesa's fixed function or ARB program paths.
*/
unsigned used:1;
+ /**
+ * Has this variable been statically assigned?
+ *
+ * This answers whether the variable was assigned in any path of
+ * the shader during ast_to_hir. This doesn't answer whether it is
+ * still written after dead code removal, nor is it maintained in
+ * non-ast_to_hir.cpp (GLSL parsing) paths.
+ */
+ unsigned assigned:1;
+
/**
* Storage class of the variable.
*
* no effect).
*/
unsigned explicit_location:1;
+ unsigned explicit_index:1;
/**
* Does this variable have an initializer?
*/
int location;
+ /**
+ * output index for dual source blending.
+ */
+ int index;
+
/**
* Built-in state that backs this uniform
*
return callee->function_name();
}
- /**
- * Get the function signature bound to this function call
- */
- ir_function_signature *get_callee()
- {
- return callee;
- }
-
- /**
- * Set the function call target
- */
- void set_callee(ir_function_signature *sig);
-
/**
* Generates an inline version of the function before @ir,
* storing the return value in return_deref.
*/
ir_dereference_variable *return_deref;
+ /**
+ * The specific function signature being called.
+ */
+ ir_function_signature *callee;
+
/* List of ir_rvalue of paramaters passed in this call. */
exec_list actual_parameters;
/** Should this call only bind to a built-in function? */
bool use_builtin;
-
-private:
- ir_function_signature *callee;
};