From d075c3c274e8f41da819a6663e12c7f4b1ea202a Mon Sep 17 00:00:00 2001 From: Elizabeth Figura Date: Fri, 7 Mar 2025 17:25:23 -0600 Subject: [PATCH] vkd3d-shader/hlsl: Fix temp allocation for ps 1.x. Iterate over the extern vars, not the parameters. The synthesized inputs and output don't go in the function parameters. Fixes: 8b57a612d77df98c69a97f31c5a844d06345482a --- libs/vkd3d-shader/hlsl_codegen.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 3b97694a..a2a10fad 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -5309,11 +5309,8 @@ static uint32_t allocate_temp_registers(struct hlsl_ctx *ctx, struct hlsl_ir_fun /* ps_1_* outputs are special and go in temp register 0. */ if (ctx->profile->major_version == 1 && ctx->profile->type == VKD3D_SHADER_TYPE_PIXEL) { - size_t i; - - for (i = 0; i < entry_func->parameters.count; ++i) + LIST_FOR_EACH_ENTRY(var, &entry_func->extern_vars, struct hlsl_ir_var, extern_entry) { - var = entry_func->parameters.vars[i]; if (var->is_output_semantic) { record_allocation(ctx, &allocator, 0, VKD3DSP_WRITEMASK_ALL,