aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-09-10 09:01:25 +0200
committermarha <marha@users.sourceforge.net>2013-09-10 09:01:25 +0200
commit889d7dd8e94a5538f388cc619115bf5c0b6fc0b7 (patch)
treebdda17693281525be9d48886acf2dc89ac4c66b4 /mesalib/src/glsl/ir.h
parent2414a1de3cc17f438219f8f2a58b530d33e99a5e (diff)
downloadvcxsrv-889d7dd8e94a5538f388cc619115bf5c0b6fc0b7.tar.gz
vcxsrv-889d7dd8e94a5538f388cc619115bf5c0b6fc0b7.tar.bz2
vcxsrv-889d7dd8e94a5538f388cc619115bf5c0b6fc0b7.zip
fontconfig libX11 libXmu libxcb mesa xserver git update 10 Sep 2013
xserver commit 47ff382d1fce25a8b097d45b79489e891f1f1228 libxcb commit f1405d9fe4a6ddcae24585ba254389a4c4f4c8c9 libX11 commit cb107760df33ffc8630677e66e2e50aa37950a5c libXmu commit 2539e539eafdac88177c8ee30b043c5d52f017e4 fontconfig commit a61e145304da86c8c35b137493bbd8fd5dd1e7f5 mesa commit 395b9410860371a64d6b5f2d50679f29eb41729e
Diffstat (limited to 'mesalib/src/glsl/ir.h')
-rw-r--r--mesalib/src/glsl/ir.h58
1 files changed, 52 insertions, 6 deletions
diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h
index b45e6cbd8..2637b40e2 100644
--- a/mesalib/src/glsl/ir.h
+++ b/mesalib/src/glsl/ir.h
@@ -591,6 +591,11 @@ public:
const glsl_type *interface_type;
};
+/**
+ * A function that returns whether a built-in function is available in the
+ * current shading language (based on version, ES or desktop, and extensions).
+ */
+typedef bool (*builtin_available_predicate)(const _mesa_glsl_parse_state *);
/*@{*/
/**
@@ -602,7 +607,8 @@ class ir_function_signature : public ir_instruction {
* an ir_function.
*/
public:
- ir_function_signature(const glsl_type *return_type);
+ ir_function_signature(const glsl_type *return_type,
+ builtin_available_predicate builtin_avail = NULL);
virtual ir_function_signature *clone(void *mem_ctx,
struct hash_table *ht) const;
@@ -678,12 +684,21 @@ public:
unsigned is_defined:1;
/** Whether or not this function signature is a built-in. */
- unsigned is_builtin:1;
+ bool is_builtin() const;
+
+ /** Whether or not a built-in is available for this shader. */
+ bool is_builtin_available(const _mesa_glsl_parse_state *state) const;
/** Body of instructions in the function. */
struct exec_list body;
private:
+ /**
+ * A function pointer to a predicate that answers whether a built-in
+ * function is available in the current shader. NULL if not a built-in.
+ */
+ builtin_available_predicate builtin_avail;
+
/** Function of which this signature is one overload. */
class ir_function *_function;
@@ -750,20 +765,23 @@ public:
* Find a signature that matches a set of actual parameters, taking implicit
* conversions into account. Also flags whether the match was exact.
*/
- ir_function_signature *matching_signature(const exec_list *actual_param,
+ ir_function_signature *matching_signature(_mesa_glsl_parse_state *state,
+ const exec_list *actual_param,
bool *match_is_exact);
/**
* Find a signature that matches a set of actual parameters, taking implicit
* conversions into account.
*/
- ir_function_signature *matching_signature(const exec_list *actual_param);
+ ir_function_signature *matching_signature(_mesa_glsl_parse_state *state,
+ const exec_list *actual_param);
/**
* Find a signature that exactly matches a set of actual parameters without
* any implicit type conversions.
*/
- ir_function_signature *exact_matching_signature(const exec_list *actual_ps);
+ ir_function_signature *exact_matching_signature(_mesa_glsl_parse_state *state,
+ const exec_list *actual_ps);
/**
* Name of the function.
@@ -1179,6 +1197,18 @@ enum ir_expression_operation {
ir_triop_lrp,
/**
+ * \name Conditional Select
+ *
+ * A vector conditional select instruction (like ?:, but operating per-
+ * component on vectors).
+ *
+ * \see lower_instructions_visitor::ldexp_to_arith
+ */
+ /*@{*/
+ ir_triop_csel,
+ /*@}*/
+
+ /**
* \name Second half of a lowered bitfieldInsert() operation.
*
* \see lower_instructions::bitfield_insert_to_bfm_bfi
@@ -1234,6 +1264,11 @@ public:
*/
ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1);
+ /**
+ * Constructor for ternary operation expressions
+ */
+ ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2);
+
virtual ir_expression *as_expression()
{
return this;
@@ -1309,7 +1344,7 @@ public:
ir_type = ir_type_call;
assert(callee->return_type != NULL);
actual_parameters->move_nodes_to(& this->actual_parameters);
- this->use_builtin = callee->is_builtin;
+ this->use_builtin = callee->is_builtin();
}
virtual ir_call *clone(void *mem_ctx, struct hash_table *ht) const;
@@ -1550,6 +1585,7 @@ public:
shadow_comparitor(NULL), offset(NULL)
{
this->ir_type = ir_type_texture;
+ memset(&lod_info, 0, sizeof(lod_info));
}
virtual ir_texture *clone(void *mem_ctx, struct hash_table *) const;
@@ -2103,9 +2139,19 @@ extern void
_mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state);
extern void
+_mesa_glsl_initialize_builtin_functions();
+
+extern ir_function_signature *
+_mesa_glsl_find_builtin_function(_mesa_glsl_parse_state *state,
+ const char *name, exec_list *actual_parameters);
+
+extern void
_mesa_glsl_release_functions(void);
extern void
+_mesa_glsl_release_builtin_functions(void);
+
+extern void
reparent_ir(exec_list *list, void *mem_ctx);
struct glsl_symbol_table;