On Sat, 2004-01-31 at 03:30, Roland Scheidegger wrote: > Hello again > > now that the lighting bugs are finally mostly gone, I've just gone ahead > and changed the lighting code a bit more... (patch against cvs, without > the earlier colormat fix). > This patch causes the driver to no longer use the PREMULT lighting, > instead it will use the SOURCE_MATERIAL stuff. Looking at r200_reg.h it > looked to me like the chip can handle a lot what is currently done in > software. So I changed that ;-) > What's new: > - no more bazillion calls of update_light_colors with lots of color > multiplications, since the chip handles that now itself. > - two-side-lighting with different materials no longer causes a tcl > fallback (so samples/fog now runs correctly, of course if you use > tcl_mode=0 it is still hosed - it looks like the tcl fallback if both > fog and two-side lighting are enabled is broken on both radeon and r200, > but that's another topic. It was the starting point for this patch > however, but I was unable to figure out what's wrong with the fallback. > The tnl stuff is scary :-(). > - removed the strange fallback if materials between begin / end were > discovered. Couldn't figure out why it was there (the comment said the > chip handles it just fine?), I thought maybe because material changes > caused for instance lighting updates, which now no longer happens. Well > so far it didn't lock up... > > There are some things I'm unsure about. For one, the > update_global_ambient now has an impossible if condition, but I have no > idea if the function works correctly now or not - it could also work > better than before, who knows ;-). There's also a lot of guesswork > involved, but at first glance things seemed to look quite good - the > patch passes the nwn and glxgears test ;-) (and some others too, but > didn't test extensively yet). > > Maybe I missed something important and this lighting code fails in some > cases horribly, but if not I think this lighting code would be much > nicer (it should likely also help TNL performance quite a bit, unless > you run on a P5 10Ghz). The code is also quite a bit simpler than before > IMHO, most of the code is just two large copy/paste if statements. > > Comments?
OK, I've spent a few hours playing with the updated patch today, and all I can say is: Good work! It fixes lighting and fog issues in many cases (including one program that segfaults without it). Also, in most the programs I've tested there are small performance improvements* (~5 fps), but the most noticable improvement (other than visual issues) is that cpu load is much lower now, especially in combination with wine. I haven't found any regressions, and unless someone finds some big error, I think this should be merged asap. My setup is Athlon64 3200, 1gb ram and radeon 9000 128mb running linux 2.6.2-rc2-mm2. Programs tested include ET, UT, Postal 2, NWN, Quake 3, Civ 3 (wine) and tons of OpenGL (native and wine) and Direct3D demos. * Notable exception being nwn which is still just as slow, but atleast it looks correct now. -- Ronny V. Vindenes <[EMAIL PROTECTED]> ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn -- _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel