[Mesa-dev] [PATCH] st/mesa: skip draw calls with pipe_draw_info::count == 0
Marek Olšák
maraeo at gmail.com
Thu Sep 7 10:33:46 UTC 2017
On Thu, Sep 7, 2017 at 2:27 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> On 07/09/17 08:37, Marek Olšák wrote:
>>
>> Ping.
>>
>> On Sat, Sep 2, 2017 at 1:34 AM, Marek Olšák <maraeo at gmail.com> wrote:
>>>
>>> From: Marek Olšák <marek.olsak at amd.com>
>>>
>>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102502
>>>
>>> Cc: 17.2 <mesa-stable at lists.freedesktop.org>
>>> ---
>>> src/mesa/state_tracker/st_draw.c | 7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/src/mesa/state_tracker/st_draw.c
>>> b/src/mesa/state_tracker/st_draw.c
>>> index fe03a4a..2fe7070 100644
>>> --- a/src/mesa/state_tracker/st_draw.c
>>> +++ b/src/mesa/state_tracker/st_draw.c
>>> @@ -191,23 +191,28 @@ st_draw_vbo(struct gl_context *ctx,
>>> if (tfb_vertcount) {
>>> if (!st_transform_feedback_draw_init(tfb_vertcount, stream,
>>> &info))
>>> return;
>>> }
>>> }
>>>
>>> assert(!indirect);
>>>
>>> /* do actual drawing */
>>> for (i = 0; i < nr_prims; i++) {
>>> + info.count = prims[i].count;
>>> +
>>> + /* Skip no-op draw calls. */
>>> + if (!info.count && !tfb_vertcount)
>>> + continue;
>
>
> I tried to reviewed this, the bit I'm unclear about is what happens if.
> info.count == 0 and tfb_vertcount != NULL
>
> It wasn't clear to me if the 0 count wasn't going to be an issue here.
> Anyway it seem clear that this isn't going to break anything that isn't
> already broken so for what its worth:
if tfb_vertcount != NULL, count is ignored by the driver and the count
is read from the stream output (transfer feedback) object.
Marek
More information about the mesa-dev
mailing list