mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 14:50:10 +01:00
There might be cases where you describe an enum in isaspec and want it to use
for decoding but also for codegen with e.g. mako.
Lets have a look at the following exmaple:
<enum name="#cond">
<value val="0" display=""/> <!-- always: display nothing -->
<value val="1" display=".gt"/>
...
</enum>
In the decoding case we want that nothing gets displayed if #cond has the value of "0". For
codegen with mako this could result in the following C code:
enum PACKED cond {
COND_ = 0,
COND_GT = 1,
...
};
What you really want is this:
enum PACKED cond {
COND_ALWAYS = 0,
COND_GT = 1,
...
};
To make this possible introduce BitSetEnumValue class which represents
an isaspec xml enum. It holds the value, displayname and now a name.
With the __str__ method the old behaviour is still intact.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25451>
|
||
|---|---|---|
| .. | ||
| clc | ||
| glsl | ||
| isaspec | ||
| nir | ||
| spirv | ||
| builtin_types.py | ||
| builtin_types_c.py | ||
| builtin_types_cpp_h.py | ||
| builtin_types_h.py | ||
| glsl_types.cpp | ||
| glsl_types.h | ||
| meson.build | ||
| nir_gl_types.h | ||
| nir_types.cpp | ||
| nir_types.h | ||
| shader_enums.c | ||
| shader_enums.h | ||
| shader_info.h | ||