From ec770b8c60dc439f5a73c46d2bd25249b1dc1a1c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 20 Nov 2005 17:57:22 +0000 Subject: move _mesa_init_instruction() to program.c --- src/mesa/shader/program.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/mesa/shader/program.c') diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 38982de993..b6371329a5 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -1191,6 +1191,31 @@ _mesa_load_state_parameters(GLcontext *ctx, } +/** + * Initialize program instruction fields to defaults. + */ +void +_mesa_init_instruction(struct prog_instruction *inst) +{ + _mesa_bzero(inst, sizeof(struct prog_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 = WRITEMASK_XYZW; + inst->DstReg.CondMask = COND_TR; + inst->DstReg.CondSwizzle = SWIZZLE_NOOP; + + inst->SaturateMode = SATURATE_OFF; + inst->Precision = FLOAT32; +} + + /** * Basic info about each instruction */ -- cgit v1.2.3