vkd3d-shader: Add some colour to the d3d-asm version token.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2021-02-19 15:57:07 +01:00 committed by Alexandre Julliard
parent 7afe9148f0
commit f0dee5a06a

View File

@ -308,6 +308,7 @@ struct vkd3d_d3d_asm_colours
const char *opcode; const char *opcode;
const char *reg; const char *reg;
const char *swizzle; const char *swizzle;
const char *version;
const char *write_mask; const char *write_mask;
}; };
@ -1692,6 +1693,7 @@ enum vkd3d_result vkd3d_dxbc_binary_to_text(void *data,
.opcode = "", .opcode = "",
.reg = "", .reg = "",
.swizzle = "", .swizzle = "",
.version = "",
.write_mask = "", .write_mask = "",
}; };
static const struct vkd3d_d3d_asm_colours colours = static const struct vkd3d_d3d_asm_colours colours =
@ -1701,6 +1703,7 @@ enum vkd3d_result vkd3d_dxbc_binary_to_text(void *data,
.opcode = "\x1b[96;1m", .opcode = "\x1b[96;1m",
.reg = "\x1b[96m", .reg = "\x1b[96m",
.swizzle = "\x1b[93m", .swizzle = "\x1b[93m",
.version = "\x1b[36m",
.write_mask = "\x1b[93m", .write_mask = "\x1b[93m",
}; };
@ -1727,8 +1730,9 @@ enum vkd3d_result vkd3d_dxbc_binary_to_text(void *data,
shader_version = &compiler.shader_version; shader_version = &compiler.shader_version;
shader_sm4_read_header(data, &ptr, shader_version); shader_sm4_read_header(data, &ptr, shader_version);
vkd3d_string_buffer_printf(buffer, "%s%s_%u_%u\n", compiler.colours.reset, vkd3d_string_buffer_printf(buffer, "%s%s_%u_%u%s\n", compiler.colours.version,
shader_get_type_prefix(shader_version->type), shader_version->major, shader_version->minor); shader_get_type_prefix(shader_version->type), shader_version->major,
shader_version->minor, compiler.colours.reset);
while (!shader_sm4_is_end(data, &ptr)) while (!shader_sm4_is_end(data, &ptr))
{ {