From 1d74ff075e211303c7ba161ed67db8cc9e180acf Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Wed, 29 Jan 2025 15:29:53 -0300 Subject: [PATCH] vkd3d-make/hlsl: Trace the number of registers allocated in allocate_temp_registers(). --- libs/vkd3d-shader/hlsl_codegen.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 176da9b4..35509abb 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -5001,7 +5001,7 @@ struct register_allocator /* Indexable temps are allocated separately and always keep their index regardless of their * lifetime. */ - size_t indexable_count; + uint32_t indexable_count; /* Total number of registers allocated so far. Used to declare sm4 temp count. */ uint32_t reg_count; @@ -5782,6 +5782,13 @@ static uint32_t allocate_temp_registers(struct hlsl_ctx *ctx, struct hlsl_ir_fun allocate_temp_registers_recurse(ctx, &entry_func->body, &allocator); vkd3d_free(allocator.allocations); + if (allocator.indexable_count) + TRACE("Declaration of function \"%s\" required %u temp registers, and %u indexable temps.\n", + entry_func->func->name, allocator.reg_count, allocator.indexable_count); + else + TRACE("Declaration of function \"%s\" required %u temp registers.\n", + entry_func->func->name, allocator.reg_count); + return allocator.reg_count; }