[PATCH 3/3] vkd3d-shader: Trace descriptor register ranges.
Conor McCarthy
cmccarthy at codeweavers.com
Tue Jul 6 20:20:16 CDT 2021
Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
libs/vkd3d-shader/trace.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c
index 8da877b4..e55ef3a2 100644
--- a/libs/vkd3d-shader/trace.c
+++ b/libs/vkd3d-shader/trace.c
@@ -762,6 +762,16 @@ static void shader_print_subscript(struct vkd3d_d3d_asm_compiler *compiler,
shader_print_uint_literal(compiler, "", offset, "]");
}
+static void shader_print_subscript_range(struct vkd3d_d3d_asm_compiler *compiler,
+ unsigned int offset_first, unsigned int offset_last)
+{
+ shader_print_uint_literal(compiler, "[", offset_first, ":");
+ if (offset_last != ~0u)
+ shader_print_uint_literal(compiler, "", offset_last, "]");
+ else
+ vkd3d_string_buffer_printf(&compiler->buffer, "*]");
+}
+
static void shader_dump_register(struct vkd3d_d3d_asm_compiler *compiler, const struct vkd3d_shader_register *reg,
bool is_descriptor_declaration)
{
@@ -1059,10 +1069,11 @@ static void shader_dump_register(struct vkd3d_d3d_asm_compiler *compiler, const
}
/* For descriptors in sm < 5.1 we move the reg->idx values up one slot
- * to normalise with 5.1. */
+ * to normalise with 5.1. For 5.1 descriptor declarations we need to
+ * trace the register range instead of a single register index. */
if (shader_ver_ge(&compiler->shader_version, 5, 1) && is_descriptor_declaration)
{
- shader_print_subscript(compiler, reg->idx[1].offset, NULL);
+ shader_print_subscript_range(compiler, reg->idx[1].offset, reg->idx[2].offset);
}
else
{
--
2.31.1
More information about the wine-devel
mailing list