diff options
author | Kenneth Graunke <[email protected]> | 2017-10-25 20:33:33 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-10-30 20:22:55 -0700 |
commit | 28fcf5cd9443ac688692c1f14e31cf4f43fd56d0 (patch) | |
tree | f86dc290b0f8536c5a33df0b232984b6d0751463 /src/intel/common/gen_decoder.h | |
parent | 53c7b8bdca5c6ef8db511f979bc2ca6467ee82c6 (diff) |
intel/genxml: Fix decoding of groups with fields smaller than a DWord.
Groups containing fields smaller than a DWord were not being decoded
correctly. For example:
<group count="32" start="32" size="4">
<field name="Vertex Element Enables" start="0" end="3" type="uint"/>
</group>
gen_field_iterator_next would properly walk over each element of the
array, incrementing group_iter, and calling iter_group_offset_bits()
to advance to the proper DWord. However, the code to print the actual
values only considered iter->field->start/end, which are 0 and 3 in the
above example. So it would always fetch bits 3:0 of the current DWord
when printing values, instead of advancing to each element of the array,
printing bits 0-3, 4-7, 8-11, and so on.
To fix this, we add new iter->start/end tracking, which properly
advances for each instance of a group's field.
Caught by Matt Turner while working on 3DSTATE_VF_COMPONENT_PACKING,
with a patch to convert it to use an array of bitfields (the example
above).
This also fixes the decoding of 3DSTATE_SBE's "Attribute Active
Component Format" fields.
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/intel/common/gen_decoder.h')
-rw-r--r-- | src/intel/common/gen_decoder.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/intel/common/gen_decoder.h b/src/intel/common/gen_decoder.h index cfc9f2e3f15..12d4551a127 100644 --- a/src/intel/common/gen_decoder.h +++ b/src/intel/common/gen_decoder.h @@ -58,6 +58,8 @@ struct gen_field_iterator { struct gen_group *struct_desc; const uint32_t *p; int dword; /**< current field starts at &p[dword] */ + int start; /**< current field starts at this bit number */ + int end; /**< current field ends at this bit number */ int field_iter; int group_iter; |