Ian Romanick wrote:
Here's a patch that prevents Think Tanks (and possibly other heavy users of triangle fans) from crashing on Radeon hardware.
To be pedantic - it's not caused by heavy usage of triangle fans, it was caused by a single triangle fan primitive occuring at the end of a cmd_buf [that could be filled with anything other than triangle fan primitives]
Right. But the odds of hitting this with infrequent use of triangle fans is pretty low. :)
Basically, I just in-lined emit_elts and did some minor clean-up.
Yeah, that should work - but I did wonder whether other primitives / paths might have the same issue? There has been a few rendering related bugs reported that are "fixed" by changing the size of cmd_buf - which is one indirect way of "fixing" something like this. Other similar errors might not cause hardware hangs.
There are a couple of other functions that look suspect: render_line_loop_elts (only if PRIM_END is set), render_tri_strip_elts (only if PRIM_PARITY is set), and render_poly_elts (this is virtually identical to render_tri_fan_elts). Neither the R100 or R200 have line-loops in hardware, so I'm not worried about render_line_loop_elts.
Given the huge numbers of apps that make massive use of triangle strips, I'm surprised that render_tri_strip_elts hasn't caused problems. NWN and FlightGear don't happen to use the render_poly_elts path, do they?
More digging required...
One problem that I have with emit_elts is that it seems to assume that the number of elts to emit is *always* a multiple of 2. Clearly this may not always be the case.
Yeah, though afaict an odd number (if that were the case) would be correctly set in the variable describing the primitive sent to the hardware - the variable(s) that are sent which describe the command itself are all a number of dwords anyway and rounded up if necessary, no?
The problem is that in some cases, like the original version of this function, you want to emit a single elt followed by additional elts as part of the same command. If the "single" elt is actually 2 elts, you end up emitting the wrong thing altogether. I'm perplexed that render_tri_fan_elts ever worked correctly.
Dunno what performance advantage emitting two at once had over emitting one, other than that, I don't suppose it matters either way.
For longer runs (i.e., large fans) I'm sure it was fairly significant. We may want to look at optimizing a couple of these code paths to use SIMD instructions, if available. I just want to make it work *correctly* first. :)
------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel