aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-10-16 11:23:27 +0200
committermarha <marha@users.sourceforge.net>2013-10-16 11:23:27 +0200
commit9e23b44bfe1e6e85231b1c07d945cadf0c868648 (patch)
tree0bd2b4d0521570bf020452591c895b90bda51095 /mesalib/src/glsl/ir.h
parent81fd17c8678e89cea6610b8b2996b028b21eb5dc (diff)
downloadvcxsrv-9e23b44bfe1e6e85231b1c07d945cadf0c868648.tar.gz
vcxsrv-9e23b44bfe1e6e85231b1c07d945cadf0c868648.tar.bz2
vcxsrv-9e23b44bfe1e6e85231b1c07d945cadf0c868648.zip
fontconfig libxcb libxcb/xcb-proto xserver mesa pixman xkbcomp git update 16 oct 2013
xserver commit 7cf1b595c8c8f9776a39559d2878cf90af3f2859 libxcb commit e4e0c6eec861f4c69da12060dc8dbe7a63fa5eb6 libxcb/xcb-proto commit 55c75accecf0e76d2aa38656efd2be4044b9e643 xkbcomp commit 839ccda42d8b088d94324cd77c4be954859914d3 pixman commit 9e81419ed5c0ee490ddacf7bada516a25cae87eb fontconfig commit 5406919c5e186f74ccdade1a65344ce7b5c56a64 mesa commit 6e444a72c1f9e4446e025b8cb780523cb89f0584
Diffstat (limited to 'mesalib/src/glsl/ir.h')
-rw-r--r--mesalib/src/glsl/ir.h91
1 files changed, 90 insertions, 1 deletions
diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h
index 1a4a3a2e3..aac8cbb7d 100644
--- a/mesalib/src/glsl/ir.h
+++ b/mesalib/src/glsl/ir.h
@@ -392,6 +392,65 @@ public:
}
/**
+ * Set this->interface_type on a newly created variable.
+ */
+ void init_interface_type(const struct glsl_type *type)
+ {
+ assert(this->interface_type == NULL);
+ this->interface_type = type;
+ if (this->is_interface_instance()) {
+ this->max_ifc_array_access =
+ rzalloc_array(this, unsigned, type->length);
+ }
+ }
+
+ /**
+ * Change this->interface_type on a variable that previously had a
+ * different, but compatible, interface_type. This is used during linking
+ * to set the size of arrays in interface blocks.
+ */
+ void change_interface_type(const struct glsl_type *type)
+ {
+ if (this->max_ifc_array_access != NULL) {
+ /* max_ifc_array_access has already been allocated, so make sure the
+ * new interface has the same number of fields as the old one.
+ */
+ assert(this->interface_type->length == type->length);
+ }
+ this->interface_type = type;
+ }
+
+ /**
+ * Change this->interface_type on a variable that previously had a
+ * different, and incompatible, interface_type. This is used during
+ * compilation to handle redeclaration of the built-in gl_PerVertex
+ * interface block.
+ */
+ void reinit_interface_type(const struct glsl_type *type)
+ {
+ if (this->max_ifc_array_access != NULL) {
+#ifndef _NDEBUG
+ /* Redeclaring gl_PerVertex is only allowed if none of the built-ins
+ * it defines have been accessed yet; so it's safe to throw away the
+ * old max_ifc_array_access pointer, since all of its values are
+ * zero.
+ */
+ for (unsigned i = 0; i < this->interface_type->length; i++)
+ assert(this->max_ifc_array_access[i] == 0);
+#endif
+ ralloc_free(this->max_ifc_array_access);
+ this->max_ifc_array_access = NULL;
+ }
+ this->interface_type = NULL;
+ init_interface_type(type);
+ }
+
+ const glsl_type *get_interface_type() const
+ {
+ return this->interface_type;
+ }
+
+ /**
* Declared type of the variable
*/
const struct glsl_type *type;
@@ -409,6 +468,19 @@ public:
unsigned max_array_access;
/**
+ * For variables which satisfy the is_interface_instance() predicate, this
+ * points to an array of integers such that if the ith member of the
+ * interface block is an array, max_ifc_array_access[i] is the maximum
+ * array element of that member that has been accessed. If the ith member
+ * of the interface block is not an array, max_ifc_array_access[i] is
+ * unused.
+ *
+ * For variables whose type is not an interface block, this pointer is
+ * NULL.
+ */
+ unsigned *max_ifc_array_access;
+
+ /**
* Is the variable read-only?
*
* This is set for variables declared as \c const, shader inputs,
@@ -582,6 +654,7 @@ public:
*/
ir_constant *constant_initializer;
+private:
/**
* For variables that are in an interface block or are an instance of an
* interface block, this is the \c GLSL_TYPE_INTERFACE type for that block.
@@ -1091,10 +1164,26 @@ enum ir_expression_operation {
ir_binop_add,
ir_binop_sub,
- ir_binop_mul,
+ ir_binop_mul, /**< Floating-point or low 32-bit integer multiply. */
+ ir_binop_imul_high, /**< Calculates the high 32-bits of a 64-bit multiply. */
ir_binop_div,
/**
+ * Returns the carry resulting from the addition of the two arguments.
+ */
+ /*@{*/
+ ir_binop_carry,
+ /*@}*/
+
+ /**
+ * Returns the borrow resulting from the subtraction of the second argument
+ * from the first argument.
+ */
+ /*@{*/
+ ir_binop_borrow,
+ /*@}*/
+
+ /**
* Takes one of two combinations of arguments:
*
* - mod(vecN, vecN)