mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
genxml: protect _length defines in genX_bits.h
Those defines exist in the packing headers too and some parts of the code (like mi_builder.h) include both. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13954>
This commit is contained in:
parent
e9b58116ea
commit
d44478483c
1 changed files with 10 additions and 4 deletions
|
|
@ -66,10 +66,16 @@ from operator import itemgetter
|
|||
#include "dev/intel_device_info.h"
|
||||
#include "util/macros.h"
|
||||
|
||||
<%def name="emit_per_gen_prop_func(item, prop)">
|
||||
<%def name="emit_per_gen_prop_func(item, prop, protect_defines)">
|
||||
%if item.has_prop(prop):
|
||||
% for gen, value in sorted(item.iter_prop(prop), reverse=True):
|
||||
% if protect_defines:
|
||||
#ifndef ${gen.prefix(item.token_name)}_${prop}
|
||||
#define ${gen.prefix(item.token_name)}_${prop} ${value}
|
||||
#endif
|
||||
% else:
|
||||
#define ${gen.prefix(item.token_name)}_${prop} ${value}
|
||||
% endif
|
||||
% endfor
|
||||
|
||||
static inline uint32_t ATTRIBUTE_PURE
|
||||
|
|
@ -101,15 +107,15 @@ extern "C" {
|
|||
|
||||
/* ${container.name} */
|
||||
|
||||
${emit_per_gen_prop_func(container, 'length')}
|
||||
${emit_per_gen_prop_func(container, 'length', True)}
|
||||
|
||||
% for _, field in sorted(container.fields.items(), key=itemgetter(0)):
|
||||
|
||||
/* ${container.name}::${field.name} */
|
||||
|
||||
${emit_per_gen_prop_func(field, 'bits')}
|
||||
${emit_per_gen_prop_func(field, 'bits', False)}
|
||||
|
||||
${emit_per_gen_prop_func(field, 'start')}
|
||||
${emit_per_gen_prop_func(field, 'start', False)}
|
||||
|
||||
% endfor
|
||||
% endfor
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue