From: Klaus N. <kl...@ma...> - 2000-11-22 10:42:04
|
Again I bore you with an idea to improve the software-rasterizer. This however should be relatively easy implemented (though the speed gain should only be minor, too). It is even so simple that I wonder if I'm getting something wrong: In 'src/swrast/s_span.c' there is e.g. the function 'gl_write_texture_span', which in turn calls first gl_texture_pixels( ctx, 0, n, s, t, u, lambda, rgba, rgba ); and _mesa_fog_rgba_pixels( ctx, n, fog, rgba ); and afterwards it does gl_scissor_span( ctx, n, x, y, mask ) and _mesa_depth_test_span( ctx, n, x, y, z, mask ); So if one of the last two functions (there are some other like stipple, alpha etc.), decides that no pixel is visible, then nothing is drawn and a 'return' is used. Would changing the order of the first two functions and the rest have any negative effect? In the special case above, this would prevent the calculation of the whole texturing and fog stuff, which in the end is not drawn anyway. As a second step (that requires some more changes) you could also use the 'mask' array to calculate the fog and the texturing only at points that are not being masked, which could give some more speed up, when you use depth and such. As always, I don't have time to do the changes myself, but maybe someone wants to try it out. Greetings Klaus |