[Mesa-dev] [PATCH] aubinator: Don't skip the first field in each subgroup
Jason Ekstrand
jason at jlekstrand.net
Sun Nov 12 23:39:30 UTC 2017
On Sun, Nov 12, 2017 at 3:29 AM, Lionel Landwerlin <
lionel.g.landwerlin at intel.com> wrote:
> On 12/11/17 05:45, Jason Ekstrand wrote:
>
>> The previous iteration algorithm would advance the field pointer right
>> after we advance the group. This meant that you would end up with
>> skipping the first field of the group. In the common case, where the
>> only field is a struct (e.g. 3DSTATE_VERTEX_BUFFERS), it would get
>> skipped entirely.
>> ---
>> src/intel/common/gen_decoder.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/intel/common/gen_decoder.c
>> b/src/intel/common/gen_decoder.c
>> index d09b6ea..b3501ae 100644
>> --- a/src/intel/common/gen_decoder.c
>> +++ b/src/intel/common/gen_decoder.c
>> @@ -824,14 +824,15 @@ iter_advance_group(struct gen_field_iterator *iter)
>> static bool
>> iter_advance_field(struct gen_field_iterator *iter)
>> {
>> - while (!iter_more_fields(iter)) {
>>
>
> If I remember correctly, I added a while to deal with empty groups.
> gen75.xml SF_CLIP_VIEWPORT has one and this will trigger a segfault.
>
I see empty groups in SF_CLIP_VIEWPORT on gen7 and gen75, SF_VIEWPORT on
gen6, and 3DSTATE_SAMPLE_PATTERN on gen8. I'm happy to just disallow that
and delete them from the XML.
> We might be better off taking it out. Otherwise, looks good :
>
> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
>
>
> + if (iter_more_fields(iter)) {
>> + iter->field = iter->field->next;
>> + } else {
>> if (!iter_more_groups(iter))
>> return false;
>> iter_advance_group(iter);
>> }
>> - iter->field = iter->field->next;
>> if (iter->field->name)
>> strncpy(iter->name, iter->field->name, sizeof(iter->name));
>> else
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171112/fb75bdfc/attachment-0001.html>
More information about the mesa-dev
mailing list