From 828dfdf1bd2905632b839974d87bca37f41825b5 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 5 Sep 2024 17:29:30 +0200 Subject: [PATCH] vkd3d-shader/ir: Run validation after normalising flat constants. --- libs/vkd3d-shader/ir.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index d87d8e0a..15cf5296 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -1913,7 +1913,8 @@ static void shader_register_normalise_flat_constants(struct vkd3d_shader_src_par param->reg.idx_count = 3; } -static enum vkd3d_result instruction_array_normalise_flat_constants(struct vsir_program *program) +static enum vkd3d_result vsir_program_normalise_flat_constants(struct vsir_program *program, + struct vsir_normalisation_context *ctx) { struct flat_constants_normaliser normaliser = {0}; unsigned int i, j; @@ -6671,13 +6672,11 @@ enum vkd3d_result vsir_program_normalise(struct vsir_program *program, uint64_t } vsir_transform(&ctx, vsir_program_normalise_io_registers); + vsir_transform(&ctx, vsir_program_normalise_flat_constants); if (ctx.result < 0) return ctx.result; - if ((result = instruction_array_normalise_flat_constants(program)) < 0) - return result; - remove_dead_code(program); if ((result = vsir_program_normalise_combined_samplers(program, message_context)) < 0)