summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_assemble_constructor.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-11-23 00:41:44 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-11-23 00:41:44 +0000
commitd426c13e46b09239eb74c716bac27a6bef9ffbde (patch)
tree450e3656488104387cb916abafe1d466ce9d0e3d /src/mesa/shader/slang/slang_assemble_constructor.c
parentdfc98c0beccadf876da4e09614c7264b765ba527 (diff)
move comments
Diffstat (limited to 'src/mesa/shader/slang/slang_assemble_constructor.c')
-rw-r--r--src/mesa/shader/slang/slang_assemble_constructor.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_assemble_constructor.c b/src/mesa/shader/slang/slang_assemble_constructor.c
index f6fb6d7c69..8b5458f766 100644
--- a/src/mesa/shader/slang/slang_assemble_constructor.c
+++ b/src/mesa/shader/slang/slang_assemble_constructor.c
@@ -34,6 +34,12 @@
+/**
+ * Checks if a field selector is a general swizzle (an r-value swizzle
+ * with replicated components or an l-value swizzle mask) for a
+ * vector. Returns GL_TRUE if this is the case, <swz> is filled with
+ * swizzle information. Returns GL_FALSE otherwise.
+ */
GLboolean
_slang_is_swizzle(const char *field, GLuint rows, slang_swizzle * swz)
{
@@ -108,6 +114,11 @@ _slang_is_swizzle(const char *field, GLuint rows, slang_swizzle * swz)
+/**
+ * Checks if a general swizzle is an l-value swizzle - these swizzles
+ * do not have duplicated fields. Returns GL_TRUE if this is a
+ * swizzle mask. Returns GL_FALSE otherwise
+ */
GLboolean
_slang_is_swizzle_mask(const slang_swizzle * swz, GLuint rows)
{
@@ -129,6 +140,10 @@ _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)