From: Giovanni Mascellani gmascellani@codeweavers.com
They are substancially different from any other register type, so it makes sense to have them stand out. Also, they help segmenting visually the code into blocks, because labels are usually found either at the beginning or at the end of a block. --- libs/vkd3d-shader/d3d_asm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index 3f86bd459..7758d5e61 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -370,6 +370,7 @@ struct vkd3d_d3d_asm_colours const char *swizzle; const char *version; const char *write_mask; + const char *label; };
struct vkd3d_d3d_asm_compiler @@ -920,7 +921,7 @@ static void shader_dump_register(struct vkd3d_d3d_asm_compiler *compiler, const static const char * const rastout_reg_names[] = {"oPos", "oFog", "oPts"}; static const char * const misctype_reg_names[] = {"vPos", "vFace"};
- shader_addline(buffer, "%s", compiler->colours.reg); + shader_addline(buffer, "%s", reg->type == VKD3DSPR_LABEL ? compiler->colours.label : compiler->colours.reg); switch (reg->type) { case VKD3DSPR_TEMP: @@ -2064,6 +2065,7 @@ enum vkd3d_result vkd3d_dxbc_binary_to_text(const struct vsir_program *program, .swizzle = "", .version = "", .write_mask = "", + .label = "", }; static const struct vkd3d_d3d_asm_colours colours = { @@ -2076,6 +2078,7 @@ enum vkd3d_result vkd3d_dxbc_binary_to_text(const struct vsir_program *program, .swizzle = "\x1b[93m", .version = "\x1b[36m", .write_mask = "\x1b[93m", + .label = "\x1b[91m", };
formatting = VKD3D_SHADER_COMPILE_OPTION_FORMATTING_INDENT