Brian Paul wrote: > I just added src/mesa/shader/programopt.c to CVS. It had been sitting > in my working tree for a while. > > The _mesa_append_modelview_code() function modifies a vertex program > with the instructions needed to implement the position invariant > option (when appropriate). > > I noticed that the r200 and r300 drivers each do this in their own > way. Perhaps they can be modified to use this new function.
Should be possible, but there is a reason that the original program is appended to the mvp transform and not the other way round. This is presumably some kind of optimization, r200 and r300 encode not only the number of instructions used, but the last instruction which deals with position. So it seems likely that there is some performance penalty if position is written last. Of course, a hardware specific optimizer would take that into account, but we lack that... There is something else not nice about it (but this is just the case now too), the tnl code (t_vb_arbprogram.c) deals with position invariant programs on its own so you'd get the mvp transform done twice in a tnl fallback presumably. (That and you'd need to take care you don't call the modify function more than once, though I think that shouldn't happen.) Roland ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
