summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2005-06-07 12:46:30 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2005-06-07 12:46:30 +0000
commit395280bf8877b023e07045e30dad812e7c32f444 (patch)
tree1c60cbeb51d5e89ede34caba3553a0b0c9473d54
parenta4691981d99495f5d0427347981df6e989b56e9c (diff)
Initialize some variables.
-rw-r--r--src/mesa/tnl/t_vb_arbprogram.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c
index 5494eed098..00a11e64c3 100644
--- a/src/mesa/tnl/t_vb_arbprogram.c
+++ b/src/mesa/tnl/t_vb_arbprogram.c
@@ -134,6 +134,8 @@ union instruction {
GLuint dword;
};
+#define RSW_NOOP ((0<<0) | (1<<2) | (2<<4) | (3<<6))
+
struct compilation {
@@ -894,7 +896,7 @@ static struct reg cvp_emit_arg( struct compilation *cp,
/* Emit any necessary swizzling.
*/
rsw.dword = 0;
- rsw.rsw.neg = src->Negate ? 1 : 0;
+ rsw.rsw.neg = src->Negate ? WRITEMASK_XYZW : 0;
rsw.rsw.swz = ((GET_SWZ(src->Swizzle, 0) << 0) |
(GET_SWZ(src->Swizzle, 1) << 2) |
(GET_SWZ(src->Swizzle, 2) << 4) |
@@ -902,10 +904,7 @@ static struct reg cvp_emit_arg( struct compilation *cp,
noop.dword = 0;
noop.rsw.neg = 0;
- noop.rsw.swz = ((0<<0) |
- (1<<2) |
- (2<<4) |
- (3<<6));
+ noop.rsw.swz = RSW_NOOP;
if (rsw.dword != noop.dword) {
union instruction *op = cvp_next_instruction(cp);
@@ -960,8 +959,6 @@ static GLuint cvp_choose_result( struct compilation *cp,
}
}
-#define RSW_NOOP ((0<<0) | (1<<2) | (2<<4) | (3<<6))
-
static struct reg cvp_emit_rsw( struct compilation *cp,
GLuint dst,
struct reg src,
@@ -1012,6 +1009,8 @@ static void cvp_emit_inst( struct compilation *cp,
struct reg reg[3];
GLuint result, i;
+ assert(sizeof(*op) == sizeof(GLuint));
+
/* Need to handle SWZ, ARL specially.
*/
switch (inst->Opcode) {
@@ -1050,8 +1049,8 @@ static void cvp_emit_inst( struct compilation *cp,
break;
case VP_OPCODE_SWZ: {
- GLuint swz0, swz1;
- GLuint neg0, neg1;
+ GLuint swz0 = 0, swz1 = 0;
+ GLuint neg0 = 0, neg1 = 0;
GLuint mask = 0;
/* Translate 3-bit-per-element swizzle into two 2-bit swizzles,