Bugzilla – Bug 66558
RS690: 3D artifacts when playing SuperTuxKart
Last modified: 2013-07-15 22:38:21 UTC
Created attachment 81975 [details]
Example of corruption in SuperTuxKart
Using the 300g driver from Mesa 9.1, the SuperTuxKart game sometimes shows artifacts, as show in the attached example.
Created attachment 81978 [details]
Created attachment 81979 [details]
Is this a regression? If so, can you bisect?
Created attachment 81980 [details] [review]
Patch that sets the needed CS buffer size in "r300_render_draw_elements"
The attached patch solves the problem for me in Mesa 9.1 and Mesa Git.
For me, it seems as if the buffer is not always properly flushed in between when "r300_render_draw_elements" has to divide it into two or more runs.
AFAIK, that bug has been in r300g from its very beginnings (in contrast to r300c).
Marek, any idea why r300_render_draw_elements() calls r300_prepare_for_rendering() with 256 dwords?
The function splits the drawing into several packets if there are too many indices. 256 dwords is a reasonable minimum for the first packet. I think the problem arises when the splitting takes place in the middle of a primitive, breaking all the primitives that follow. I'll send a patch.
Created attachment 82446 [details] [review]
Please try this patch.
Marek, your patch solves the problem for me. Thanks!
I committed the patch as 22427640b248aeb9875b40b216d27bedb13a1db8. Closing.