Roland Scheidegger wrote: > 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...
Thanks for the info. The above-mentioned function could easily be modified to insert the new instructions at the top of the program. I see in the r200 code that the DP4 instruction might not always work for some reason. An option for that could also be implemented in _mesa_append_modelview_code(). > 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.) Right. I'll take care of that if/when I use _mesa_append_modelview_code() in the software t&l code. -Brian ------------------------------------------------------------------------- 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 Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev