diff options
author | Brian <[email protected]> | 2007-02-23 16:48:07 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-02-23 16:48:07 -0700 |
commit | 6df328e84d270ad0e6e2fab9a884313f0e780aa1 (patch) | |
tree | dd4b64573117e2349816adce1d8fcb34bb85a578 /src | |
parent | 064ae479a770bf434958d673baf6f7530f642697 (diff) |
don't pass program ptr to fetch_vector[14]()
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/shader/prog_execute.c | 166 |
1 files changed, 82 insertions, 84 deletions
diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index f466cc7affb..d75a55b95b1 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -161,7 +161,6 @@ static void fetch_vector4( GLcontext *ctx, const struct prog_src_register *source, const struct gl_program_machine *machine, - const struct gl_program *program, GLfloat result[4] ) { const GLfloat *src = get_register_pointer(ctx, source, machine); @@ -323,7 +322,6 @@ static void fetch_vector1( GLcontext *ctx, const struct prog_src_register *source, const struct gl_program_machine *machine, - const struct gl_program *program, GLfloat result[4] ) { const GLfloat *src = get_register_pointer(ctx, source, machine); @@ -644,7 +642,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_ABS: { GLfloat a[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); result[0] = FABSF(a[0]); result[1] = FABSF(a[1]); result[2] = FABSF(a[2]); @@ -655,8 +653,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_ADD: { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = a[0] + b[0]; result[1] = a[1] + b[1]; result[2] = a[2] + b[2]; @@ -705,9 +703,9 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_CMP: { GLfloat a[4], b[4], c[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); - fetch_vector4( ctx, &inst->SrcReg[2], machine, program, c ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); + fetch_vector4( ctx, &inst->SrcReg[2], machine, c ); result[0] = a[0] < 0.0F ? b[0] : c[0]; result[1] = a[1] < 0.0F ? b[1] : c[1]; result[2] = a[2] < 0.0F ? b[2] : c[2]; @@ -718,7 +716,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_COS: { GLfloat a[4], result[4]; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = result[3] = (GLfloat) _mesa_cos(a[0]); store_vector4( inst, machine, result ); @@ -782,8 +780,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_DP3: { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = result[1] = result[2] = result[3] = DOT3(a, b); store_vector4( inst, machine, result ); if (DEBUG_PROG) { @@ -795,8 +793,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_DP4: { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = result[1] = result[2] = result[3] = DOT4(a,b); store_vector4( inst, machine, result ); if (DEBUG_PROG) { @@ -809,8 +807,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_DPH: { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = result[1] = result[2] = result[3] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + b[3]; store_vector4( inst, machine, result ); @@ -819,8 +817,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_DST: /* Distance vector */ { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = 1.0F; result[1] = a[1] * b[1]; result[2] = a[2]; @@ -831,7 +829,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_EX2: /* Exponential base 2 */ { GLfloat a[4], result[4]; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = result[3] = (GLfloat) _mesa_pow(2.0, a[0]); store_vector4( inst, machine, result ); @@ -840,7 +838,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_FLR: { GLfloat a[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); result[0] = FLOORF(a[0]); result[1] = FLOORF(a[1]); result[2] = FLOORF(a[2]); @@ -851,7 +849,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_FRC: { GLfloat a[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); result[0] = a[0] - FLOORF(a[0]); result[1] = a[1] - FLOORF(a[1]); result[2] = a[2] - FLOORF(a[2]); @@ -880,7 +878,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_INT: /* float to int */ { GLfloat a[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); result[0] = (GLfloat) (GLint) a[0]; result[1] = (GLfloat) (GLint) a[1]; result[2] = (GLfloat) (GLint) a[2]; @@ -896,7 +894,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_KIL: /* ARB_f_p only */ { GLfloat a[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); if (a[0] < 0.0F || a[1] < 0.0F || a[2] < 0.0F || a[3] < 0.0F) { return GL_FALSE; } @@ -905,7 +903,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_LG2: /* log base 2 */ { GLfloat a[4], result[4]; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = result[3] = LOG2(a[0]); store_vector4( inst, machine, result ); } @@ -914,7 +912,7 @@ _mesa_execute_program(GLcontext *ctx, { const GLfloat epsilon = 1.0F / 256.0F; /* from NV VP spec */ GLfloat a[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); a[0] = MAX2(a[0], 0.0F); a[1] = MAX2(a[1], 0.0F); /* XXX ARB version clamps a[3], NV version doesn't */ @@ -943,9 +941,9 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_LRP: { GLfloat a[4], b[4], c[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); - fetch_vector4( ctx, &inst->SrcReg[2], machine, program, c ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); + fetch_vector4( ctx, &inst->SrcReg[2], machine, c ); result[0] = a[0] * b[0] + (1.0F - a[0]) * c[0]; result[1] = a[1] * b[1] + (1.0F - a[1]) * c[1]; result[2] = a[2] * b[2] + (1.0F - a[2]) * c[2]; @@ -964,9 +962,9 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_MAD: { GLfloat a[4], b[4], c[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); - fetch_vector4( ctx, &inst->SrcReg[2], machine, program, c ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); + fetch_vector4( ctx, &inst->SrcReg[2], machine, c ); result[0] = a[0] * b[0] + c[0]; result[1] = a[1] * b[1] + c[1]; result[2] = a[2] * b[2] + c[2]; @@ -985,8 +983,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_MAX: { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = MAX2(a[0], b[0]); result[1] = MAX2(a[1], b[1]); result[2] = MAX2(a[2], b[2]); @@ -1003,8 +1001,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_MIN: { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = MIN2(a[0], b[0]); result[1] = MIN2(a[1], b[1]); result[2] = MIN2(a[2], b[2]); @@ -1015,7 +1013,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_MOV: { GLfloat result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, result ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, result ); store_vector4( inst, machine, result ); if (DEBUG_PROG) { printf("MOV (%g %g %g %g)\n", @@ -1026,8 +1024,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_MUL: { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = a[0] * b[0]; result[1] = a[1] * b[1]; result[2] = a[2] * b[2]; @@ -1044,7 +1042,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_NOISE1: { GLfloat a[4], result[4]; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = @@ -1055,7 +1053,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_NOISE2: { GLfloat a[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = @@ -1066,7 +1064,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_NOISE3: { GLfloat a[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = @@ -1077,7 +1075,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_NOISE4: { GLfloat a[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = @@ -1093,7 +1091,7 @@ _mesa_execute_program(GLcontext *ctx, GLhalfNV hx, hy; GLuint *rawResult = (GLuint *) result; GLuint twoHalves; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); hx = _mesa_float_to_half(a[0]); hy = _mesa_float_to_half(a[1]); twoHalves = hx | (hy << 16); @@ -1106,7 +1104,7 @@ _mesa_execute_program(GLcontext *ctx, { GLfloat a[4], result[4]; GLuint usx, usy, *rawResult = (GLuint *) result; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); a[0] = CLAMP(a[0], 0.0F, 1.0F); a[1] = CLAMP(a[1], 0.0F, 1.0F); usx = IROUND(a[0] * 65535.0F); @@ -1120,7 +1118,7 @@ _mesa_execute_program(GLcontext *ctx, { GLfloat a[4], result[4]; GLuint ubx, uby, ubz, ubw, *rawResult = (GLuint *) result; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); a[0] = CLAMP(a[0], -128.0F / 127.0F, 1.0F); a[1] = CLAMP(a[1], -128.0F / 127.0F, 1.0F); a[2] = CLAMP(a[2], -128.0F / 127.0F, 1.0F); @@ -1138,7 +1136,7 @@ _mesa_execute_program(GLcontext *ctx, { GLfloat a[4], result[4]; GLuint ubx, uby, ubz, ubw, *rawResult = (GLuint *) result; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); a[0] = CLAMP(a[0], 0.0F, 1.0F); a[1] = CLAMP(a[1], 0.0F, 1.0F); a[2] = CLAMP(a[2], 0.0F, 1.0F); @@ -1155,8 +1153,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_POW: { GLfloat a[4], b[4], result[4]; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector1( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector1( ctx, &inst->SrcReg[1], machine, b ); result[0] = result[1] = result[2] = result[3] = (GLfloat)_mesa_pow(a[0], b[0]); store_vector4( inst, machine, result ); @@ -1165,7 +1163,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_RCP: { GLfloat a[4], result[4]; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); if (DEBUG_PROG) { if (a[0] == 0) printf("RCP(0)\n"); @@ -1187,8 +1185,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_RFL: /* reflection vector */ { GLfloat axis[4], dir[4], result[4], tmpX, tmpW; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, axis ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, dir ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, axis ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, dir ); tmpW = DOT3(axis, axis); tmpX = (2.0F * DOT3(axis, dir)) / tmpW; result[0] = tmpX * axis[0] - dir[0]; @@ -1201,7 +1199,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_RSQ: /* 1 / sqrt() */ { GLfloat a[4], result[4]; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); a[0] = FABSF(a[0]); result[0] = result[1] = result[2] = result[3] = INV_SQRTF(a[0]); store_vector4( inst, machine, result ); @@ -1213,7 +1211,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_SCS: /* sine and cos */ { GLfloat a[4], result[4]; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); result[0] = (GLfloat) _mesa_cos(a[0]); result[1] = (GLfloat) _mesa_sin(a[0]); result[2] = 0.0; /* undefined! */ @@ -1224,8 +1222,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_SEQ: /* set on equal */ { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = (a[0] == b[0]) ? 1.0F : 0.0F; result[1] = (a[1] == b[1]) ? 1.0F : 0.0F; result[2] = (a[2] == b[2]) ? 1.0F : 0.0F; @@ -1242,8 +1240,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_SGE: /* set on greater or equal */ { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = (a[0] >= b[0]) ? 1.0F : 0.0F; result[1] = (a[1] >= b[1]) ? 1.0F : 0.0F; result[2] = (a[2] >= b[2]) ? 1.0F : 0.0F; @@ -1254,8 +1252,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_SGT: /* set on greater */ { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = (a[0] > b[0]) ? 1.0F : 0.0F; result[1] = (a[1] > b[1]) ? 1.0F : 0.0F; result[2] = (a[2] > b[2]) ? 1.0F : 0.0F; @@ -1270,7 +1268,7 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_SIN: { GLfloat a[4], result[4]; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = result[3] = (GLfloat) _mesa_sin(a[0]); store_vector4( inst, machine, result ); @@ -1279,8 +1277,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_SLE: /* set on less or equal */ { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = (a[0] <= b[0]) ? 1.0F : 0.0F; result[1] = (a[1] <= b[1]) ? 1.0F : 0.0F; result[2] = (a[2] <= b[2]) ? 1.0F : 0.0F; @@ -1291,8 +1289,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_SLT: /* set on less */ { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = (a[0] < b[0]) ? 1.0F : 0.0F; result[1] = (a[1] < b[1]) ? 1.0F : 0.0F; result[2] = (a[2] < b[2]) ? 1.0F : 0.0F; @@ -1303,8 +1301,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_SNE: /* set on not equal */ { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = (a[0] != b[0]) ? 1.0F : 0.0F; result[1] = (a[1] != b[1]) ? 1.0F : 0.0F; result[2] = (a[2] != b[2]) ? 1.0F : 0.0F; @@ -1321,8 +1319,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_SUB: { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = a[0] - b[0]; result[1] = a[1] - b[1]; result[2] = a[2] - b[2]; @@ -1377,7 +1375,7 @@ _mesa_execute_program(GLcontext *ctx, else #endif lambda = 0.0; - fetch_vector4(ctx, &inst->SrcReg[0], machine, program, coord); + fetch_vector4(ctx, &inst->SrcReg[0], machine, coord); machine->FetchTexelLod(ctx, coord, lambda, inst->TexSrcUnit, color); if (DEBUG_PROG) { printf("TEX (%g, %g, %g, %g) = texture[%d][%g, %g, %g, %g], " @@ -1402,7 +1400,7 @@ _mesa_execute_program(GLcontext *ctx, else #endif lambda = 0.0; - fetch_vector4(ctx, &inst->SrcReg[0], machine, program, coord); + fetch_vector4(ctx, &inst->SrcReg[0], machine, coord); /* coord[3] is the bias to add to lambda */ bias = texUnit->LodBias + coord[3]; if (texUnit->_Current) @@ -1416,9 +1414,9 @@ _mesa_execute_program(GLcontext *ctx, /* Texture lookup w/ partial derivatives for LOD */ { GLfloat texcoord[4], dtdx[4], dtdy[4], color[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, texcoord ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, dtdx ); - fetch_vector4( ctx, &inst->SrcReg[2], machine, program, dtdy ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, texcoord ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, dtdx ); + fetch_vector4( ctx, &inst->SrcReg[2], machine, dtdy ); machine->FetchTexelDeriv(ctx, texcoord, dtdx, dtdy, inst->TexSrcUnit, color ); store_vector4( inst, machine, color ); @@ -1435,7 +1433,7 @@ _mesa_execute_program(GLcontext *ctx, else #endif lambda = 0.0; - fetch_vector4(ctx, &inst->SrcReg[0], machine, program,texcoord); + fetch_vector4(ctx, &inst->SrcReg[0], machine, texcoord); /* Not so sure about this test - if texcoord[3] is * zero, we'd probably be fine except for an ASSERT in * IROUND_POS() which gets triggered by the inf values created. @@ -1461,7 +1459,7 @@ _mesa_execute_program(GLcontext *ctx, else #endif lambda = 0.0; - fetch_vector4(ctx, &inst->SrcReg[0], machine, program,texcoord); + fetch_vector4(ctx, &inst->SrcReg[0], machine, texcoord); if (inst->TexSrcTarget != TEXTURE_CUBE_INDEX && texcoord[3] != 0.0) { texcoord[0] /= texcoord[3]; @@ -1478,7 +1476,7 @@ _mesa_execute_program(GLcontext *ctx, GLfloat a[4], result[4]; const GLuint *rawBits = (const GLuint *) a; GLhalfNV hx, hy; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); hx = rawBits[0] & 0xffff; hy = rawBits[0] >> 16; result[0] = result[2] = _mesa_half_to_float(hx); @@ -1491,7 +1489,7 @@ _mesa_execute_program(GLcontext *ctx, GLfloat a[4], result[4]; const GLuint *rawBits = (const GLuint *) a; GLushort usx, usy; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); usx = rawBits[0] & 0xffff; usy = rawBits[0] >> 16; result[0] = result[2] = usx * (1.0f / 65535.0f); @@ -1503,7 +1501,7 @@ _mesa_execute_program(GLcontext *ctx, { GLfloat a[4], result[4]; const GLuint *rawBits = (const GLuint *) a; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); result[0] = (((rawBits[0] >> 0) & 0xff) - 128) / 127.0F; result[1] = (((rawBits[0] >> 8) & 0xff) - 128) / 127.0F; result[2] = (((rawBits[0] >> 16) & 0xff) - 128) / 127.0F; @@ -1515,7 +1513,7 @@ _mesa_execute_program(GLcontext *ctx, { GLfloat a[4], result[4]; const GLuint *rawBits = (const GLuint *) a; - fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + fetch_vector1( ctx, &inst->SrcReg[0], machine, a ); result[0] = ((rawBits[0] >> 0) & 0xff) / 255.0F; result[1] = ((rawBits[0] >> 8) & 0xff) / 255.0F; result[2] = ((rawBits[0] >> 16) & 0xff) / 255.0F; @@ -1526,8 +1524,8 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_XPD: /* cross product */ { GLfloat a[4], b[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); result[0] = a[1] * b[2] - a[2] * b[1]; result[1] = a[2] * b[0] - a[0] * b[2]; result[2] = a[0] * b[1] - a[1] * b[0]; @@ -1538,9 +1536,9 @@ _mesa_execute_program(GLcontext *ctx, case OPCODE_X2D: /* 2-D matrix transform */ { GLfloat a[4], b[4], c[4], result[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); - fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b ); - fetch_vector4( ctx, &inst->SrcReg[2], machine, program, c ); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a ); + fetch_vector4( ctx, &inst->SrcReg[1], machine, b ); + fetch_vector4( ctx, &inst->SrcReg[2], machine, c ); result[0] = a[0] + b[0] * c[0] + b[1] * c[1]; result[1] = a[1] + b[0] * c[2] + b[1] * c[3]; result[2] = a[2] + b[0] * c[0] + b[1] * c[1]; @@ -1552,7 +1550,7 @@ _mesa_execute_program(GLcontext *ctx, { if (inst->SrcReg[0].File != -1) { GLfloat a[4]; - fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a); + fetch_vector4( ctx, &inst->SrcReg[0], machine, a); _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, a[0], a[1], a[2], a[3]); } |