summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-07-01 18:39:22 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-07-01 18:39:22 -0600
commit81a0acca31aa8f96ac9488ff81345a6cd51403a4 (patch)
tree63d850c5fd58cc11ea9968f767426ac4258ef04c /src
parent44c99ad23655204fd2e567fc38512f12e5f262af (diff)
mesa: make _slang_swizzle_swizzle() non-private
cherry-picked from master
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/slang/slang_emit.c17
-rw-r--r--src/mesa/shader/slang/slang_emit.h8
2 files changed, 16 insertions, 9 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index 93256f8647..6d79380ab5 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 7.0.3
+ * Version: 7.1
*
- * Copyright (C) 2005-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -110,13 +110,16 @@ writemask_to_swizzle(GLuint writemask)
/**
* Swizzle a swizzle. That is, return swz2(swz1)
*/
-static GLuint
-swizzle_swizzle(GLuint swz1, GLuint swz2)
+GLuint
+_slang_swizzle_swizzle(GLuint swz1, GLuint swz2)
{
GLuint i, swz, s[4];
for (i = 0; i < 4; i++) {
GLuint c = GET_SWZ(swz2, i);
- s[i] = GET_SWZ(swz1, c);
+ if (c <= SWIZZLE_W)
+ s[i] = GET_SWZ(swz1, c);
+ else
+ s[i] = c;
}
swz = MAKE_SWIZZLE4(s[0], s[1], s[2], s[3]);
return swz;
@@ -1459,8 +1462,8 @@ emit_swizzle(slang_emit_info *emitInfo, slang_ir_node *n)
/* apply this swizzle to child's swizzle to get composed swizzle */
swizzle = fix_swizzle(n->Store->Swizzle); /* remove the don't care terms */
- n->Store->Swizzle = swizzle_swizzle(n->Children[0]->Store->Swizzle,
- swizzle);
+ n->Store->Swizzle = _slang_swizzle_swizzle(n->Children[0]->Store->Swizzle,
+ swizzle);
return inst;
}
diff --git a/src/mesa/shader/slang/slang_emit.h b/src/mesa/shader/slang/slang_emit.h
index 13ba6d7d6c..7d70b3311b 100644
--- a/src/mesa/shader/slang/slang_emit.h
+++ b/src/mesa/shader/slang/slang_emit.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.1
*
- * Copyright (C) 2005-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2005-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -36,6 +36,10 @@ extern void
slang_print_ir(const slang_ir_node *n, int indent);
+extern GLuint
+_slang_swizzle_swizzle(GLuint swz1, GLuint swz2);
+
+
extern slang_ir_storage *
_slang_new_ir_storage(enum register_file file, GLint index, GLint size);