-/* $Id: nvvertexec.c,v 1.4 2003/03/25 00:00:29 brianp Exp $ */
+/* $Id: nvvertexec.c,v 1.5 2003/03/29 16:04:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
const GLfloat *src;
if (source->RelAddr) {
- GLint reg = source->Register + machine->AddressReg;
- if (reg < VP_PROG_REG_START || reg > VP_PROG_REG_END)
+ const GLint reg = source->Register + machine->AddressReg;
+ if (reg < 0 || reg > MAX_NV_VERTEX_PROGRAM_PARAMS)
src = zero;
else
- src = machine->Registers[reg];
+ src = machine->Registers[VP_PROG_REG_START + reg];
}
else {
src = machine->Registers[source->Register];
const GLfloat *src;
if (source->RelAddr) {
- GLint reg = source->Register + machine->AddressReg;
- if (reg < VP_PROG_REG_START || reg > VP_PROG_REG_END)
+ const GLint reg = source->Register + machine->AddressReg;
+ if (reg < 0 || reg > MAX_NV_VERTEX_PROGRAM_PARAMS)
src = zero;
else
- src = machine->Registers[reg];
+ src = machine->Registers[VP_PROG_REG_START + reg];
}
else {
src = machine->Registers[source->Register];
struct vp_machine *machine = &ctx->VertexProgram.Machine;
const struct vp_instruction *inst;
- /* XXX load vertex fields into input registers */
- /* and do other initialization */
-
-
for (inst = program->Instructions; inst->Opcode != VP_OPCODE_END; inst++) {
switch (inst->Opcode) {
case VP_OPCODE_MOV:
floor_t0 = (float) floor(t[0]);
if (floor_t0 > FLT_MAX_EXP) {
SET_POS_INFINITY(q[0]);
- q[1] = 0.0F;
SET_POS_INFINITY(q[2]);
- q[3] = 1.0F;
}
else if (floor_t0 < FLT_MIN_EXP) {
q[0] = 0.0F;
- q[1] = 0.0F;
q[2] = 0.0F;
- q[3] = 0.0F;
}
else {
#ifdef USE_IEEE
#else
q[0] = (GLfloat) pow(2.0, floor_t0);
#endif
- q[1] = t[0] - floor_t0;
q[2] = (GLfloat) (q[0] * LOG2(q[1]));
- q[3] = 1.0F;
}
+ q[1] = t[0] - floor_t0;
+ q[3] = 1.0F;
store_vector4( &inst->DstReg, machine, q );
}
break;