summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2010-07-21 15:54:15 -0700
committerKenneth Graunke <[email protected]>2010-07-28 15:46:26 -0700
commitee9a3a51b61f0afe75b4b8b0c3025310140437ec (patch)
treee314dbfda4aa77b54675dfb07377d77a8b6e63a9 /src/glsl/ir.h
parent0c7b37c8367e72e7b4295cd249561e5c3079d161 (diff)
glsl2: Add new ir_constant::zero static method.
This conveniently creates a zero value of whatever type you want.
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 202685d145a..bee9f6a2de4 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1248,6 +1248,11 @@ public:
*/
ir_constant(const ir_constant *c, unsigned i);
+ /**
+ * Return a new ir_constant of the specified type containing all zeros.
+ */
+ static ir_constant *zero(void *mem_ctx, const glsl_type *type);
+
virtual ir_constant *clone(struct hash_table *) const;
virtual ir_constant *constant_expression_value();