static void emit_op3fn(struct tnl_program *p, GLuint op, struct ureg dest, GLuint mask, struct ureg src0, struct ureg src1, struct ureg src2, const char *fn, GLuint line) { GLuint nr = p->program->Base.NumInstructions++; if (nr >= p->nr_instructions) { p->program->Base.Instructions = _mesa_realloc(p->program->Base.Instructions, sizeof(struct prog_instruction) * p->nr_instructions, sizeof(struct prog_instruction) * (p->nr_instructions *= 2)); } { struct prog_instruction *inst = &p->program->Base.Instructions[nr]; memset(inst, 0, sizeof(*inst)); inst->Opcode = op; inst->StringPos = 0; inst->Data = 0; emit_arg( &inst->SrcReg[0], src0 ); emit_arg( &inst->SrcReg[1], src1 ); emit_arg( &inst->SrcReg[2], src2 ); emit_dst( &inst->DstReg, dest, mask ); debug_insn(inst, fn, line); } }
static void emit_op3fn(struct tnl_program *p, enum prog_opcode op, struct ureg dest, GLuint mask, struct ureg src0, struct ureg src1, struct ureg src2, const char *fn, GLuint line) { GLuint nr = p->program->Base.NumInstructions++; struct prog_instruction *inst = &p->program->Base.Instructions[nr]; if (p->program->Base.NumInstructions > MAX_INSN) { _mesa_problem(0, "Out of instructions in emit_op3fn\n"); return; } inst->Opcode = (enum prog_opcode) op; inst->StringPos = 0; inst->Data = 0; emit_arg( &inst->SrcReg[0], src0 ); emit_arg( &inst->SrcReg[1], src1 ); emit_arg( &inst->SrcReg[2], src2 ); emit_dst( &inst->DstReg, dest, mask ); debug_insn(inst, fn, line); }
static void emit_op3fn(struct tnl_program *p, enum prog_opcode op, struct ureg dest, GLuint mask, struct ureg src0, struct ureg src1, struct ureg src2, const char *fn, GLuint line) { GLuint nr; struct prog_instruction *inst; assert((GLint) p->program->Base.NumInstructions <= p->max_inst); if (p->program->Base.NumInstructions == p->max_inst) { /* need to extend the program's instruction array */ struct prog_instruction *newInst; /* double the size */ p->max_inst *= 2; newInst = _mesa_alloc_instructions(p->max_inst); if (!newInst) { _mesa_error(NULL, GL_OUT_OF_MEMORY, "vertex program build"); return; } _mesa_copy_instructions(newInst, p->program->Base.Instructions, p->program->Base.NumInstructions); _mesa_free_instructions(p->program->Base.Instructions, p->program->Base.NumInstructions); p->program->Base.Instructions = newInst; } nr = p->program->Base.NumInstructions++; inst = &p->program->Base.Instructions[nr]; inst->Opcode = (enum prog_opcode) op; inst->Data = 0; emit_arg( &inst->SrcReg[0], src0 ); emit_arg( &inst->SrcReg[1], src1 ); emit_arg( &inst->SrcReg[2], src2 ); emit_dst( &inst->DstReg, dest, mask ); debug_insn(inst, fn, line); }