diff options
author | Brian Paul <[email protected]> | 2005-10-30 21:23:23 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-10-30 21:23:23 +0000 |
commit | 7aebaf3debc6482b49faee5ed38418ad3d35fc30 (patch) | |
tree | d3794359358ea33e561dd8bdbc84c34cfc229688 /src/mesa/shader/nvvertparse.c | |
parent | 094a1ddf2498d598da5abaef6d6ed53ec2dbe6dc (diff) |
Lots of clean-up in arb program parser.
Use new _mesa_init_fp/vp_instruction() function to initialize instructions.
Diffstat (limited to 'src/mesa/shader/nvvertparse.c')
-rw-r--r-- | src/mesa/shader/nvvertparse.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 33bc2004acd..c48a4cb358f 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1142,11 +1142,7 @@ Parse_InstructionSequence(struct parse_state *parseState, struct vp_instruction *inst = program + parseState->numInst; /* Initialize the instruction */ - 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; + _mesa_init_vp_instruction(inst); if (Parse_String(parseState, "MOV")) { if (!Parse_UnaryOpInstruction(parseState, inst, VP_OPCODE_MOV)) @@ -1601,3 +1597,22 @@ _mesa_nv_vertex_output_register_name(GLuint i) ASSERT(i < MAX_NV_VERTEX_PROGRAM_OUTPUTS); return OutputRegisters[i]; } + + +/** + * Initialize vertex program instruction fields to defaults. + */ +void +_mesa_init_vp_instruction(struct vp_instruction *inst) +{ + _mesa_bzero(inst, sizeof(struct vp_instruction)); + inst->SrcReg[0].File = PROGRAM_UNDEFINED; + inst->SrcReg[0].Swizzle = SWIZZLE_NOOP; + inst->SrcReg[1].File = PROGRAM_UNDEFINED; + inst->SrcReg[1].Swizzle = SWIZZLE_NOOP; + inst->SrcReg[2].File = PROGRAM_UNDEFINED; + inst->SrcReg[2].Swizzle = SWIZZLE_NOOP; + inst->DstReg.File = PROGRAM_UNDEFINED; + inst->DstReg.WriteMask = 0xf; +} + |