summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-06-25 15:25:27 -0700
committerIan Romanick <[email protected]>2010-06-29 11:15:26 -0700
commit6315b68f5fbe529bce3497b67c42af1eaa62b8c1 (patch)
tree2e864350bf4eb205f384d939ac841fafc448f84e /src/glsl/ir.h
parent50577b96ac07bc24af1ef8e2490cb633aa84dd7d (diff)
ir_swizzle: Add new constructor, refactor constructors
Adds a new constructor that takes an array of component values. Refactors the meat of the two constructors to an init_mask method.
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 3d2c7ff5cf5..de1124975d2 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -918,6 +918,9 @@ class ir_swizzle : public ir_rvalue {
public:
ir_swizzle(ir_rvalue *, unsigned x, unsigned y, unsigned z, unsigned w,
unsigned count);
+
+ ir_swizzle(ir_rvalue *val, const unsigned *components, unsigned count);
+
ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask);
virtual ir_instruction *clone(struct hash_table *) const;
@@ -951,6 +954,14 @@ public:
ir_rvalue *val;
ir_swizzle_mask mask;
+
+private:
+ /**
+ * Initialize the mask component of a swizzle
+ *
+ * This is used by the \c ir_swizzle constructors.
+ */
+ void init_mask(const unsigned *components, unsigned count);
};