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.
This commit is contained in:
Giovanni Mascellani 2024-03-07 14:47:32 +01:00 committed by Alexandre Julliard
parent e65055b435
commit 21f76257b0
Notes: Alexandre Julliard 2024-03-08 23:48:39 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/693

View File

@ -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