diff options
author | Brian Paul <[email protected]> | 2005-07-22 02:53:38 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-07-22 02:53:38 +0000 |
commit | 61e694f270d8a4a03a3245b5e6eea805915ed74b (patch) | |
tree | 1a0d95f224b5493df55b67f909d28561f367ca36 | |
parent | db251d72c84256267cd1f7c062071a7143455048 (diff) |
Make the vertex program source register Index field a signed int since
relative addressing can be negative.
Change some GLuint indexes to GLint in the t_vp_build.c file.
Added PROGRAM_UNDEFINED token for initializing the register File field to
avoid a gcc 4.0 warning.
-rw-r--r-- | src/mesa/main/mtypes.h | 3 | ||||
-rw-r--r-- | src/mesa/shader/nvvertparse.c | 8 | ||||
-rw-r--r-- | src/mesa/shader/nvvertprog.h | 12 | ||||
-rw-r--r-- | src/mesa/tnl/t_vp_build.c | 2 |
4 files changed, 13 insertions, 12 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d4f6c1f0d57..6c036da8743 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1738,7 +1738,8 @@ enum register_file PROGRAM_NAMED_PARAM, PROGRAM_STATE_VAR, PROGRAM_WRITE_ONLY, - PROGRAM_ADDRESS + PROGRAM_ADDRESS, + PROGRAM_UNDEFINED /* invalid value */ }; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index c6fb72d931e..33bc2004acd 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1142,10 +1142,10 @@ Parse_InstructionSequence(struct parse_state *parseState, struct vp_instruction *inst = program + parseState->numInst; /* Initialize the instruction */ - inst->SrcReg[0].File = (enum register_file) -1; - inst->SrcReg[1].File = (enum register_file) -1; - inst->SrcReg[2].File = (enum register_file) -1; - inst->DstReg.File = (enum register_file) -1; + inst->SrcReg[0].File = PROGRAM_UNDEFINED; + inst->SrcReg[1].File = PROGRAM_UNDEFINED; + inst->SrcReg[2].File = PROGRAM_UNDEFINED; + inst->DstReg.File = PROGRAM_UNDEFINED; inst->Data = NULL; if (Parse_String(parseState, "MOV")) { diff --git a/src/mesa/shader/nvvertprog.h b/src/mesa/shader/nvvertprog.h index 17646e3600b..b8dbe363134 100644 --- a/src/mesa/shader/nvvertprog.h +++ b/src/mesa/shader/nvvertprog.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.3.1 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -76,19 +76,19 @@ enum vp_opcode /* Instruction source register */ struct vp_src_register { - GLuint File:4; - GLuint Index:8; + GLuint File:4; /* one of the PROGRAM_* register file values */ + GLint Index:9; /* may be negative for relative addressing */ GLuint Swizzle:12; GLuint Negate:4; /* ARB requires component-wise negation. */ GLuint RelAddr:1; - GLuint pad:3; + GLuint pad:2; }; /* Instruction destination register */ struct vp_dst_register { - GLuint File:4; + GLuint File:4; /* one of the PROGRAM_* register file values */ GLuint Index:8; GLuint WriteMask:4; GLuint pad:16; diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 11fdc454cd3..fc9fb15bd58 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -247,7 +247,7 @@ static struct state_key *make_state_key( GLcontext *ctx ) */ struct ureg { GLuint file:4; - GLuint idx:8; + GLint idx:8; /* relative addressing may be negative */ GLuint negate:1; GLuint swz:12; GLuint pad:7; |