vkd3d-shader/msl: Use vsir_opcode_get_name() in msl_unhandled().

This commit is contained in:
Henri Verbeet
2025-06-03 13:55:11 +02:00
parent a5ff884605
commit dfb3494600
Notes: Henri Verbeet 2025-06-11 20:38:03 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1561

View File

@@ -612,10 +612,12 @@ static void VKD3D_PRINTF_FUNC(3, 4) msl_print_assignment(
static void msl_unhandled(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins) static void msl_unhandled(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins)
{ {
const char *name = vsir_opcode_get_name(ins->opcode, "<unknown>");
msl_print_indent(gen->buffer, gen->indent); msl_print_indent(gen->buffer, gen->indent);
vkd3d_string_buffer_printf(gen->buffer, "/* <unhandled instruction %#x> */\n", ins->opcode); vkd3d_string_buffer_printf(gen->buffer, "/* <unhandled instruction \"%s\" (%#x)> */\n", name, ins->opcode);
msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL, msl_compiler_error(gen, VKD3D_SHADER_ERROR_MSL_INTERNAL,
"Internal compiler error: Unhandled instruction %#x.", ins->opcode); "Internal compiler error: Unhandled instruction \"%s\" (%#x).", name, ins->opcode);
} }
static void msl_binop(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins, const char *op) static void msl_binop(struct msl_generator *gen, const struct vkd3d_shader_instruction *ins, const char *op)