summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-02-02 18:00:03 -0700
committerBrian <brian@yutani.localnet.net>2007-02-02 18:00:03 -0700
commit1b3092e4bb89b7a5bd64a3e27f82299d4b2669a2 (patch)
treea62f8a5c1aaf6f4bed2b3f96769cae78e94ee682 /src/mesa/shader/slang
parentbf823b6b77d01b4c4839f4ad05383fc9ec8095be (diff)
add _slang_multiply_swizzles()
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r--src/mesa/shader/slang/slang_typeinfo.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c
index 8bedb40435a..5a3c2eac6b4 100644
--- a/src/mesa/shader/slang/slang_typeinfo.c
+++ b/src/mesa/shader/slang/slang_typeinfo.c
@@ -151,6 +151,22 @@ _slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows)
}
+/**
+ * Combines (multiplies) two swizzles to form single swizzle.
+ * Example: "vec.wzyx.yx" --> "vec.zw".
+ */
+GLvoid
+_slang_multiply_swizzles(slang_swizzle * dst, const slang_swizzle * left,
+ const slang_swizzle * right)
+{
+ GLuint i;
+
+ dst->num_components = right->num_components;
+ for (i = 0; i < right->num_components; i++)
+ dst->swizzle[i] = left->swizzle[right->swizzle[i]];
+}
+
+
GLvoid
slang_type_specifier_ctr(slang_type_specifier * self)
{