Module: vkd3d Branch: master Commit: 37401fa11cc80ea9e7287c13b3605f93601d1348 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/37401fa11cc80ea9e7287c13b3605f...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Mar 14 20:26:58 2024 +0100
vkd3d-shader/d3d-asm: Pass a prefix and suffix to shader_dump_reg_type().
---
libs/vkd3d-shader/d3d_asm.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index 3c5e7ff2..6ff02375 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -1388,8 +1388,8 @@ static void shader_print_non_uniform(struct vkd3d_d3d_asm_compiler *compiler, co compiler->colours.modifier, compiler->colours.reset); }
-static void shader_dump_reg_type(struct vkd3d_d3d_asm_compiler *compiler, - const struct vkd3d_shader_register *reg) +static void shader_print_reg_type(struct vkd3d_d3d_asm_compiler *compiler, + const char *prefix, const struct vkd3d_shader_register *reg, const char *suffix) { static const char *dimensions[] = { @@ -1402,7 +1402,10 @@ static void shader_dump_reg_type(struct vkd3d_d3d_asm_compiler *compiler, const char *dimension;
if (!(compiler->flags & VSIR_ASM_FLAG_DUMP_TYPES)) + { + vkd3d_string_buffer_printf(buffer, "%s%s", prefix, suffix); return; + }
if (reg->data_type == VKD3D_DATA_UNUSED) return; @@ -1412,9 +1415,9 @@ static void shader_dump_reg_type(struct vkd3d_d3d_asm_compiler *compiler, else dimension = "??";
- shader_addline(buffer, " <%s", dimension); + vkd3d_string_buffer_printf(buffer, "%s <%s", prefix, dimension); shader_dump_data_type(compiler, reg->data_type); - shader_addline(buffer, ">"); + vkd3d_string_buffer_printf(buffer, ">%s", suffix); }
static void shader_print_write_mask(struct vkd3d_d3d_asm_compiler *compiler, @@ -1460,8 +1463,7 @@ static void shader_print_dst_param(struct vkd3d_d3d_asm_compiler *compiler,
shader_print_precision(compiler, ¶m->reg); shader_print_non_uniform(compiler, ¶m->reg); - shader_dump_reg_type(compiler, ¶m->reg); - vkd3d_string_buffer_printf(&compiler->buffer, "%s", suffix); + shader_print_reg_type(compiler, "", ¶m->reg, suffix); }
static void shader_print_src_param(struct vkd3d_d3d_asm_compiler *compiler, @@ -1552,8 +1554,7 @@ static void shader_print_src_param(struct vkd3d_d3d_asm_compiler *compiler,
shader_print_precision(compiler, ¶m->reg); shader_print_non_uniform(compiler, ¶m->reg); - shader_dump_reg_type(compiler, ¶m->reg); - vkd3d_string_buffer_printf(buffer, "%s", suffix); + shader_print_reg_type(compiler, "", ¶m->reg, suffix); }
static void shader_dump_ins_modifiers(struct vkd3d_d3d_asm_compiler *compiler,