glsl: Generate strings that are the enum names without the ir_*op_ prefix
For many expressions, this is different from the printable name. The printable name for ir_binop_add is "+", but we want "add". This is needed for ir_builder_print_visitor. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
@@ -1471,6 +1471,7 @@ public:
|
||||
#include "ir_expression_operation.h"
|
||||
|
||||
extern const char *const ir_expression_operation_strings[ir_last_opcode + 1];
|
||||
extern const char *const ir_expression_operation_enum_strings[ir_last_opcode + 1];
|
||||
|
||||
class ir_expression : public ir_rvalue {
|
||||
public:
|
||||
|
@@ -707,6 +707,12 @@ const char *const ir_expression_operation_strings[] = {
|
||||
% for item in values:
|
||||
"${item.printable_name}",
|
||||
% endfor
|
||||
};
|
||||
|
||||
const char *const ir_expression_operation_enum_strings[] = {
|
||||
% for item in values:
|
||||
"${item.name}",
|
||||
% endfor
|
||||
};""")
|
||||
|
||||
constant_template = mako.template.Template("""\
|
||||
|
Reference in New Issue
Block a user