{
struct ureg shininess = get_material(p, 0, STATE_SHININESS);
emit_op1(p, OPCODE_MOV, dots, WRITEMASK_W, swizzle1(shininess,X));
- release_temp(p, shininess);
_col0 = make_temp(p, get_scenecolor(p, 0));
if (separate)
struct ureg shininess = get_material(p, 1, STATE_SHININESS);
emit_op1(p, OPCODE_MOV, dots, WRITEMASK_Z,
negate(swizzle1(shininess,X)));
- release_temp(p, shininess);
_bfc0 = make_temp(p, get_scenecolor(p, 1));
if (separate)
struct ureg tmpPpli = get_temp(p);
VPpli = get_temp(p);
- half = get_temp(p);
/* In homogeneous object coordinates
*/
*/
emit_op2(p, OPCODE_SUB, VPpli, 0, tmpPpli, V);
+ /* we're done with tmpPpli now */
+ release_temp(p, tmpPpli);
+
/* Normalize VPpli. The dist value also used in
* attenuation below.
*/
p->state->unit[i].light_attenuated) {
att = calculate_light_attenuation(p, i, VPpli, dist);
}
+
+ /* We're done with dist now */
+ release_temp(p, dist);
/* Calculate viewer direction, or use infinite viewer:
*/
+ half = get_temp(p);
if (p->state->light_local_viewer) {
struct ureg eye_hat = get_eye_position_normalized(p);
emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat);
}
emit_normalize_vec3(p, half, half);
-
- release_temp(p, dist);
- release_temp(p, tmpPpli);
}
/* Calculate dot products:
emit_op2(p, OPCODE_DP3, dots, WRITEMASK_X, normal, VPpli);
emit_op2(p, OPCODE_DP3, dots, WRITEMASK_Y, normal, half);
+ /* we're done with VPpli and half now, so free them as to not drive up
+ our temp usage unnecessary */
+ release_temp(p, VPpli);
+ release_temp(p, half);
/* Front face lighting:
*/
release_temp(p, specular);
}
- release_temp(p, half);
- release_temp(p, VPpli);
release_temp(p, att);
}
}