[Mesa-dev] [PATCH] draw: fix splitting of line loops

Brian Paul brianp at vmware.com
Mon Oct 19 07:29:22 PDT 2015


On 10/19/2015 04:53 AM, Roland Scheidegger wrote:
> I thought just changing the prim type would cause the loop to not get
> closed in the end, albeit I looked at it only briefly (I thought the
> DRAW_SPLIT_AFTER/BEFORE flags were supposed to be able to deal with this
> but couldn't figure out how). But if this works correctly,

Yeah, everything I've tested looks good now with this change.  That 
said, I don't know all the ins and outs of that code either and it's 
possible there's more to do.  But it's certainly better than before.

-Brian

>
> Reviewed-by: Roland Scheidegger <sroland at vmware.com>
>
> Am 17.10.2015 um 20:27 schrieb Brian Paul:
>> When the draw module splits long line loops, the sections are emitted
>> as line strips.  But the primitive type wasn't set correctly so each
>> section was being drawn as a loop, introducing extra line segments.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81174
>> ---
>>   src/gallium/auxiliary/draw/draw_pt_vsplit.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/auxiliary/draw/draw_pt_vsplit.c b/src/gallium/auxiliary/draw/draw_pt_vsplit.c
>> index 8d448f9..02f7e71 100644
>> --- a/src/gallium/auxiliary/draw/draw_pt_vsplit.c
>> +++ b/src/gallium/auxiliary/draw/draw_pt_vsplit.c
>> @@ -256,8 +256,11 @@ static void vsplit_prepare(struct draw_pt_front_end *frontend,
>>         break;
>>      }
>>
>> -   /* split only */
>> -   vsplit->prim = in_prim;
>> +   /* Line loops get split into line strips. Other types stay as-is. */
>> +   if (in_prim == PIPE_PRIM_LINE_LOOP)
>> +      vsplit->prim = PIPE_PRIM_LINE_STRIP;
>> +   else
>> +      vsplit->prim = in_prim;
>>
>>      vsplit->middle = middle;
>>      middle->prepare(middle, vsplit->prim, opt, &vsplit->max_vertices);
>>
>



More information about the mesa-dev mailing list