diff options
author | Roland Scheidegger <[email protected]> | 2007-03-13 19:04:28 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2007-03-13 19:04:28 +0100 |
commit | a6cc9ab493a2efa9a0ea91cddba0e85c8c8c83f1 (patch) | |
tree | 159d709b3354a19fd9885842d0565398edc44d59 /src/mesa/tnl | |
parent | 37e6f760fde506728077c6e8b48bb8c34d53dfd3 (diff) |
sync up t_vp_build.c brw_vs_tnl.c a bit
Bring over the optimizations for fog and normalized spot dir
from t_vp_build.c to brw_vs_tnl.c. Likewise, port a fix for point size
calc from brw_vs_tnl.c to t_vp_build.c (use ABS(eyez) instead of -eyez). Leave
the now differing point size calcs alone though, not sure what's better (it's
basically MOV, ABS, MUL, DP3 vs. ABS, MAD, MAD).
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r-- | src/mesa/tnl/t_vp_build.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 2a97a1c8c76..2663d993049 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -1329,14 +1329,16 @@ static void build_pointsize( struct tnl_program *p ) struct ureg out = register_output(p, VERT_RESULT_PSIZ); struct ureg ut = get_temp(p); + /* dist = |eyez| */ + emit_op1(p, OPCODE_ABS, ut, WRITEMASK_Y, swizzle1(eye, Z)); /* p1 + dist * (p2 + dist * p3); */ - emit_op3(p, OPCODE_MAD, ut, 0, negate(swizzle1(eye, Z)), + emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y), swizzle1(state_attenuation, Z), swizzle1(state_attenuation, Y)); - emit_op3(p, OPCODE_MAD, ut, 0, negate(swizzle1(eye, Z)), + emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y), ut, swizzle1(state_attenuation, X)); /* 1 / sqrt(factor) */ - emit_op1(p, OPCODE_RSQ, ut, 0, ut ); + emit_op1(p, OPCODE_RSQ, ut, WRITEMASK_X, ut ); #if 1 /* out = pointSize / sqrt(factor) */ @@ -1344,8 +1346,8 @@ static void build_pointsize( struct tnl_program *p ) #else /* not sure, might make sense to do clamping here, but it's not done in t_vb_points neither */ - emit_op2(p, OPCODE_MUL, ut, 0, ut, state_size); - emit_op2(p, OPCODE_MAX, ut, 0, ut, swizzle1(state_size, Y)); + emit_op2(p, OPCODE_MUL, ut, WRITEMASK_X, ut, state_size); + emit_op2(p, OPCODE_MAX, ut, WRITEMASK_X, ut, swizzle1(state_size, Y)); emit_op2(p, OPCODE_MIN, out, WRITEMASK_X, ut, swizzle1(state_size, Z)); #endif |