From: Felix <fx...@gm...> - 2004-12-20 16:03:56
|
Hi Keith, I'm attaching my current solution for the Savage driver. I'm going to commit this later today. It doesn't need any modifications of the common TNL code. It is probably not the most efficient solution though, since it requires an indirect function call for each emitted vertex. That said, I havn't noticed any performance regressions which may be because the Savage hardware is quite slow in relation to my CPU (mobile Athlon XP 2000+). Also see my comments below ... Am Sa, den 18.12.2004 schrieb Keith Whitwell um 0:37: > Felix K=FChling wrote: > > Am Fr, den 17.12.2004 schrieb Keith Whitwell um 22:59: [snip] > >>Secondly, is the obvious counter-concern -- what happens with clipping?= =20 > >> The 'post processing' probably needs to be undone so that clipping ca= n=20 > >>proceed, then be re-done on the clipped vertices, right? > >=20 > >=20 > > Right. But that would have been broken with t_dd_vbtmp.h too. ;-) >=20 > No, t_dd_vbtmp.h *does* undo the projection, look around line 534. Ok, sorry. I missed that detail. Though I do have a question about this code: rqdst =3D 1.0 / qdst; dst->v.u0 *=3D rqdst; dst->v.v0 *=3D rqdst; dst->v.w *=3D rqdst; Shouldn't the last line say: dst->v.w *=3D qdst; I don't claim to understand the math behind this completely, but that would be the analogue thing to the code around line 277. [ ... your other reply ... ] > I can think of the i810 and mga which both have this projective texture=20 > issue *and* have the fast path (in i810render.c and mga_render.c=20 > respectively). It (used to be?) a worthwhile optimization. I didn't know about the i810 driver. But in the MGA driver the render stage is disabled. AFAICT it has been since the transition to Mesa 4. Anyway, my solution is very driver-specific. Whoever is going to port this to i810 will have to deal with the fallback case to the _tnl_render_stage. I'd like to implement a render stage for the Savage driver at some point. This way we could reduce the number of vertices emitted to the hardware by using triangle strips and fans where appropriate. It would also minimize the impact of indirect function calls per vertex. >=20 > Keith Regards, Felix --=20 | Felix K=FChling <fx...@gm...> http://fxk.de.vu | | PGP Fingerprint: 6A3C 9566 5B30 DDED 73C3 B152 151C 5CC1 D888 E595 | |