mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 13:40:11 +01:00
intel/genxml: Simplify prefix handling for field value lists
When a <field> tag has multiple <value> children, listing symbolic names for possible field values, we generate #defines for each value, with an optional prefix. I don't know why, but this code was checking whether self.default is None. We want to generate the same list of #defines, with a prefix, regardless of whether the field has a default value specified or not. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13809>
This commit is contained in:
parent
f4004fde26
commit
cd7d3c7ae3
1 changed files with 1 additions and 4 deletions
|
|
@ -333,10 +333,7 @@ class Field(object):
|
|||
|
||||
print(" %-36s %s%s;" % (type, self.name, dim))
|
||||
|
||||
prefix = ""
|
||||
if self.values and self.default is None:
|
||||
if self.prefix:
|
||||
prefix = self.prefix + "_"
|
||||
prefix = self.prefix + '_' if self.prefix else ''
|
||||
|
||||
for value in self.values:
|
||||
print("#define %-40s %d" % (prefix + value.name, value.value))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue