diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index 2a607add..9fe4b744 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -1312,6 +1312,23 @@ static void shader_print_register(struct vkd3d_d3d_asm_compiler *compiler, const } vkd3d_string_buffer_printf(buffer, ")"); } + else if (compiler->flags & VSIR_ASM_FLAG_DUMP_ALL_INDICES) + { + unsigned int i = 0; + + if (reg->idx_count == 0 || reg->idx[0].rel_addr) + { + vkd3d_string_buffer_printf(buffer, "%s", compiler->colours.reset); + } + else + { + vkd3d_string_buffer_printf(buffer, "%u%s", offset, compiler->colours.reset); + i = 1; + } + + for (; i < reg->idx_count; ++i) + shader_print_subscript(compiler, reg->idx[i].offset, reg->idx[i].rel_addr); + } else if (reg->type != VKD3DSPR_RASTOUT && reg->type != VKD3DSPR_MISCTYPE && reg->type != VKD3DSPR_NULL @@ -2484,10 +2501,11 @@ enum vkd3d_result d3d_asm_compile(const struct vsir_program *program, void vkd3d_shader_trace(const struct vsir_program *program) { - const char *p, *q, *end; + const unsigned int flags = VSIR_ASM_FLAG_DUMP_TYPES | VSIR_ASM_FLAG_DUMP_ALL_INDICES; struct vkd3d_shader_code code; + const char *p, *q, *end; - if (d3d_asm_compile(program, NULL, &code, VSIR_ASM_FLAG_DUMP_TYPES) != VKD3D_OK) + if (d3d_asm_compile(program, NULL, &code, flags) != VKD3D_OK) return; end = (const char *)code.code + code.size; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 9d808435..cec0f356 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -1490,6 +1490,7 @@ enum vsir_asm_flags { VSIR_ASM_FLAG_NONE = 0, VSIR_ASM_FLAG_DUMP_TYPES = 0x1, + VSIR_ASM_FLAG_DUMP_ALL_INDICES = 0x2, }; enum vkd3d_result d3d_asm_compile(const struct vsir_program *program,