<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 12, 2017 at 3:29 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 12/11/17 05:45, Jason Ekstrand wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The previous iteration algorithm would advance the field pointer right<br>
after we advance the group. This meant that you would end up with<br>
skipping the first field of the group. In the common case, where the<br>
only field is a struct (e.g. 3DSTATE_VERTEX_BUFFERS), it would get<br>
skipped entirely.<br>
---<br>
src/intel/common/gen_decoder.c | 5 +++--<br>
1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/intel/common/gen_decoder<wbr>.c b/src/intel/common/gen_decoder<wbr>.c<br>
index d09b6ea..b3501ae 100644<br>
--- a/src/intel/common/gen_decoder<wbr>.c<br>
+++ b/src/intel/common/gen_decoder<wbr>.c<br>
@@ -824,14 +824,15 @@ iter_advance_group(struct gen_field_iterator *iter)<br>
static bool<br>
iter_advance_field(struct gen_field_iterator *iter)<br>
{<br>
- while (!iter_more_fields(iter)) {<br>
</blockquote>
<br></span>
If I remember correctly, I added a while to deal with empty groups.<br>
gen75.xml SF_CLIP_VIEWPORT has one and this will trigger a segfault.<br></blockquote><div><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We might be better off taking it out. Otherwise, looks good :<br>
<br>
Reviewed-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a><wbr>><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ if (iter_more_fields(iter)) {<br>
+ iter->field = iter->field->next;<br>
+ } else {<br>
if (!iter_more_groups(iter))<br>
return false;<br>
iter_advance_group(iter);<br>
}<br>
- iter->field = iter->field->next;<br>
if (iter->field->name)<br>
strncpy(iter->name, iter->field->name, sizeof(iter->name));<br>
else<br>
</blockquote>
<br>
<br>
</div></div></blockquote></div><br></div></div>