While I'm waiting to merge the texmem-0-0-1 branch into the trunk, I've been looking into the problems with Unreal Tournament 2003 on the R200 driver.

Here's how I've set up my debug environment, in case anyone wants to reproduce what I've done. Attached is a script, do_ut2k3 that I use to start UT2k3 and get it into the debugger. In addition, I modified line 524 of r200_ioctl.c (in the texmem branch) to be:

if ( rmesa->sarea->pfCurrentPage == 0 ) {

This causes the driver to draw to the currently displayed page (you must be using page flipping!). This was easier than tricking UT2k3 to use single buffered visuals.

After getting it into GDB, "cont" until you the SSE test in the driver. At this point you may need to "sharedlibrary" to load the symbols from libGL.so and r200_dri.so. Then set a breakpoint at r200FlushCmdBufferLocked. "cont" until the Nvidia logo rotates around and the guy emerges from it. First his head and neck will be drawn. The first rendering problem will be when the gun is drawn. After that, all hell breaks loose!

I have attached the stderr output from a test run to this point. The last output is from the gun being drawn. Everything before that is drawn correctly. The rendering problems coincide with some state changes. The other thing that I noticed is that R200_SE_TCL_OUTPUT_VTX_FMT_1 is set to 0x4. Does this mean that only texture unit 0 is used, and there are 4 texture components (i.e., s, t, r, and q)? That seems odd.

It seems that some state is not being emitted that should be. Anyone have any idea where to direct my search at this point?
#!/bin/sh

export R200_DEBUG=prims,sanity,sync,ioctl
export DISPLAY=:0

ut2003 > /tmp/ut.output 2>&1 &
sleep 10
exec gdb /usr/local/games/ut2003/System/ut2003-bin $(ps -C ut2003-bin --format pid h | 
head -1)

Reply via email to