From 5fd93c28c43fabb3fae6e5ff81c9a80dc1e046e8 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 5 Sep 2024 17:11:59 +0200 Subject: [PATCH] vkd3d-shader/ir: Run validation after remapping the output signature. --- libs/vkd3d-shader/ir.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index a483c25f..a51804cb 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -551,9 +551,11 @@ static const struct vkd3d_shader_varying_map *find_varying_map( } static enum vkd3d_result vsir_program_remap_output_signature(struct vsir_program *program, - const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_message_context *message_context) + struct vsir_normalisation_context *ctx) { - const struct vkd3d_shader_location location = {.source_name = compile_info->source_name}; + const struct vkd3d_shader_location location = {.source_name = ctx->compile_info->source_name}; + struct vkd3d_shader_message_context *message_context = ctx->message_context; + const struct vkd3d_shader_compile_info *compile_info = ctx->compile_info; struct shader_signature *signature = &program->output_signature; const struct vkd3d_shader_varying_map_info *varying_map; unsigned int i; @@ -6657,15 +6659,12 @@ enum vkd3d_result vsir_program_normalise(struct vsir_program *program, uint64_t } else { + if (program->shader_version.type != VKD3D_SHADER_TYPE_PIXEL) + vsir_transform(&ctx, vsir_program_remap_output_signature); + if (ctx.result < 0) return ctx.result; - if (program->shader_version.type != VKD3D_SHADER_TYPE_PIXEL) - { - if ((result = vsir_program_remap_output_signature(program, compile_info, message_context)) < 0) - return result; - } - if (program->shader_version.type == VKD3D_SHADER_TYPE_HULL) { if ((result = instruction_array_flatten_hull_shader_phases(&program->instructions)) < 0)