On Sun, 21 Dec 2003 10:41:24 -0500 Keith Whitwell <[EMAIL PROTECTED]> wrote:
> Felix Kühling wrote: [snip] > > My first approach was to restore the old primitive after each clipped > > one. But that would result in reduntant primitive switching if several > > primitives are clipped in a row. Therefore I came up with the > > last_clipped variable. > > I see where you're going. I agree that probably some further mechanism would > be required to make my scheme efficient. > > If primitive switching is a significant cost, is it worthwhile using hardware > quads when clipping is known to be likely? > > This problem doesn't show up in the other drivers because when clipping is > known likely, they all decompose all 'higher' primitives to triangles. This > means more vertices are sent to the card, but at the benefit of sending fewer > primitives. > > For vertex-buffers where VB->ClipOrMask == 0, and it is known that clipping > will not occur, there is the code in eg. i830_render.c which will endeavour to > send whole primitives down to the card. Note that even in this case it is not > always advantageous to do so - large numbers of small triangle-strips or fans > are handled faster on the i830 by sending a single large list of triangles due > to the overheads of starting a new primitive. > > Keith Interesting. More stuff to think about ... and experiment. :) The way the savage driver works now it emits one command for each primitive. Commands and vertex data are mixed in the same DMA buffer. The command contains information about the primitive type and vertex format and the number of vertices that follow. At the moment I don't know the overhead of this procedure. But it makes it straight forward to emit quads as small tri-fans instead of pairs of triangles. This gives a noticable speedup with glxgears at least. I'm going to try to rewrite the DMA code as to emit larger numbers of triangles with one command. This is really an experiment and I have no idea how much speedup (or slowdown) it'll yield. Considering your arguments above I guess it would not be worth writing a clean primitive switching solution in the TNL code right now (unless you can't resist the temptation ;-). I can do with my hack on the branch only and once we know a bit more about the savage performance we can either drop it or make a real solution. Felix ------------ __\|/__ ___ ___ ------------------------- Felix ___\_e -_/___/ __\___/ __\_____ You can do anything, Kühling (_____\Ä/____/ /_____/ /________) just not everything [EMAIL PROTECTED] \___/ \___/ U at the same time. ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click -- _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel