Module: vkd3d Branch: master Commit: 21f76257b04915d06cec32a6f508222d2755ad05 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/21f76257b04915d06cec32a6f50822...
Author: Giovanni Mascellani gmascellani@codeweavers.com Date: Thu Mar 7 14:47:32 2024 +0100
vkd3d-shader/d3d-asm: Print labels in red.
They are substantially 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 21212ae0..ddd1f221 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -372,6 +372,7 @@ struct vkd3d_d3d_asm_colours const char *swizzle; const char *version; const char *write_mask; + const char *label; };
struct vkd3d_d3d_asm_compiler @@ -922,7 +923,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: @@ -2245,6 +2246,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 = { @@ -2257,6 +2259,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