From f4d95af91d13756de79337631cd04e6a0045f2d5 Mon Sep 17 00:00:00 2001 From: "Anna (navi) Figueiredo Gomes" Date: Wed, 2 Jul 2025 23:09:32 +0200 Subject: [PATCH] vkd3d-shader/hlsl: Add temporary variables to "dummy_scope" in prepend_uniform_copy(). These are not looked up by name, so we don't need them in a specific scope. Moreover, since we generate the temporaries using the same storage modifiers as the uniforms, hlsl_emit_bytecode() will treat them as new uniforms if run multiple times. That function is currently only run once, but this will change when compiling shaders in effects. --- libs/vkd3d-shader/hlsl_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 092771158..1d06ffd61 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -201,7 +201,7 @@ static void prepend_uniform_copy(struct hlsl_ctx *ctx, struct hlsl_block *block, vkd3d_free(new_name); return; } - list_add_before(&uniform->scope_entry, &temp->scope_entry); + list_add_tail(&ctx->dummy_scope->vars, &temp->scope_entry); uniform->temp_copy = temp;