On Wed, May 28, 2003 at 11:25:12PM -0700, Ian Romanick wrote:
> If you can cook up a small test case that shows this bug (shouldn't be 
> too hard), I'll take a crack at fixing it. :)  Does this happen with the 
> code in XFree86 CVS or just DRI CVS?

Probably harder than just fixing it though :o) Since it's clear from Keith's
and my message what the problem is and triggering it depends on splitting a
primitive across 2 cmdbufs at exactly the right point.

To continue from Keith's message, at the point where the initial checks are
done (the currentsz/dmasz stuff which you need for cases where you have more
elts than will fit in one cmdbuf) 

You can't know how much buffer there is left without taking into account the
amount of state that will be emitted, (as the comment in the source for
GET_CURRENT_VB_MAX_ELTS() states) so I can't see a NEW_ELT_BUFFER being robust
without either excess work calculating state, and without duplicating the
checks for a continuation of a primitive that ALLOC_ELTS does anyway.

So, since ALLOC_ELTS()/emit_elts will already flush correct wrt state and a
continued primitive etc, it'd probably be as well to change emit_elts so it
doesn't do the ALLOC_ELTS, and then make the callers ALLOC_ELTS with values
that won't break?

So triangle_fan_elts would look something like:-

ALLOC_ELTS(nr);
emit_elts(...,1);
emit_elts(...,nr-1);

rather than the way it effectively works now

ALLOC_ELTS(1);
emit_elt(...,1);
ALLOC_ELTS(nr-1);
emit_elts(...,nr-1);


-- 
Michael.


-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to