From: Jeff E. <je...@ds...> - 2001-05-07 20:26:48
|
I'm currently trying to move an older piece of software from using PEX/X11 to Mesa/X11. (We use(d) a modified version of PEX with zbuffer support, and it's becoming too much of a chore to propogate these patches to new versions of XFree86) Our software draws exclusively flat-shaded, zbuffered polygons. Out of the box (Mesa 3.2/RedHat 6.2) or using Mesa 3.4.1, the Mesa renderer is rather slower than our PEX-based renderer. However, a simple change to write_span_mono_pixmap brings the two renderers to nearly equal speed. Basically, we discovered in past iterations of software renderers that coalescing as many pixels as possible into single X calls is a very important optimization (in fact, another dead renderer actually unifies multiple single-color spans into a single XDrawSegments call). write_span_mono_pixmap performs this optimization using XMesaFillRectangle when no pixels in the span were excluded (due to depth check or other factors) However, if any pixels were excluded, then it falls back to XMesaDrawPoint for all points. This patch accumulates consecutive "drawn" pixels into a single XMesaFillRectangle call. This is a big speed boost in our application, and a slight pessimization in the case of e.g., a 50% stipple. (XFillRectangle is likely to be optimized for the 1x1 case, as well as the Nx1 case) A slightly more intelligent patch would probably disable the optimization for very short spans, or spans with large numbers of sub-spans. I'll include the patch in my message. Is submitting it to the sourceforge patch tracker appropriate? It doesn't look like that SF feature is well-used. Jeff |