[Mesa-dev] [PATCH 1/7] gallium: fold u_trim_pipe_prim call from st/mesa to drivers
Ilia Mirkin
imirkin at alum.mit.edu
Thu Apr 20 16:07:04 UTC 2017
On Thu, Apr 20, 2017 at 12:00 PM, Marek Olšák <maraeo at gmail.com> wrote:
> On Fri, Apr 14, 2017 at 6:47 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>> On Fri, Apr 14, 2017 at 12:42 PM, Marek Olšák <maraeo at gmail.com> wrote:
>>> On Fri, Apr 14, 2017 at 5:45 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>>>> On Fri, Apr 14, 2017 at 11:07 AM, Marek Olšák <maraeo at gmail.com> wrote:
>>>>> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
>>>>> index bc9b9a1..295c394 100644
>>>>> --- a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
>>>>> +++ b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
>>>>> @@ -543,20 +543,23 @@ nv30_draw_elements(struct nv30_context *nv30, bool shorten,
>>>>> }
>>>>> }
>>>>>
>>>>> static void
>>>>> nv30_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
>>>>> {
>>>>> struct nv30_context *nv30 = nv30_context(pipe);
>>>>> struct nouveau_pushbuf *push = nv30->base.pushbuf;
>>>>> int i;
>>>>>
>>>>> + if (!u_trim_pipe_prim(info->mode, (unsigned*)&info->count))
>>>>> + return;
>>>>> +
>>>>
>>>> Should this also have a !info->primitive_restart? It's supported on
>>>> nv4x (covered by this driver).
>>>
>>> In that case, I wonder if u_trim_pipe_prim is required with this
>>> driver. It might be better to just remove that call.
>>
>> Based on a quick look, this seems to exist to prevent short draws and
>> trim the count to the nearest prim size, i.e. if you try to draw a tri
>> with %3 != 0 vertices, or a line with %2 != 0? I'm not 100% sure that
>> the NV30 HW handles those correctly, but it probably does. I can
>> double-check tonight, as I have one plugged in these days.
>
> I'll just add this. Is it OK?
Yeah, that's fine. Sorry, I totally spaced on testing out the hw. I'll
make a note to do that in a place where I'll hopefully remember, and
remove the whole thing if it's all supported.
>
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
> b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
> index 295c394..316f868 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c
> @@ -550,7 +550,8 @@ nv30_draw_vbo(struct pipe_context *pipe, const
> struct pipe_draw_info *info)
> struct nouveau_pushbuf *push = nv30->base.pushbuf;
> int i;
>
> - if (!u_trim_pipe_prim(info->mode, (unsigned*)&info->count))
> + if (!info->primitive_restart &&
> + !u_trim_pipe_prim(info->mode, (unsigned*)&info->count))
> return;
>
> /* For picking only a few vertices from a large user buffer, push is better,
>
> Marek
More information about the mesa-dev
mailing list