genxml: Fix decoding of array groups.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 19 May 2017 22:31:35 +0000 (15:31 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 1 Jun 2017 18:49:45 +0000 (11:49 -0700)
commit73c21e69d0c132a6d837b40b6a863bdd406085d4
tree24d6f4473fbee6b670f0ea9b610429decbcaac53
parentd1b949282f6387e9dc4a9a43defc8aaa08749c0a
genxml: Fix decoding of array groups.

If you had a group as the first element of a struct, i.e.

  <struct name="3DSTATE_CONSTANT_BODY" length="10">
    <group count="4" start="0" size="16">
      <field name="ReadLength" start="0" end="15" type="uint"/>
    </group>
    ...
  </struct>

we would get a group_offset of 0, causing create_field() to think the
field wasn't in a group, and fail to offset forward for successive array
elements.  So we'd mark all the array elements as offset 0.

Using ctx->group->elem_size is a better check for "are we in a group?".

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/common/gen_decoder.c