From c2fd1e42fd1d2b72b47e125ea90bff6f6ff979a6 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 5 Sep 2024 17:30:48 +0200 Subject: [PATCH] vkd3d-shader/ir: Run validation after removing dead code. --- libs/vkd3d-shader/ir.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 68f2e2f7..7e5c63f5 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -1961,7 +1961,8 @@ static enum vkd3d_result vsir_program_normalise_flat_constants(struct vsir_progr return VKD3D_OK; } -static void remove_dead_code(struct vsir_program *program) +static enum vkd3d_result vsir_program_remove_dead_code(struct vsir_program *program, + struct vsir_normalisation_context *ctx) { size_t i, depth = 0; bool dead = false; @@ -2049,6 +2050,8 @@ static void remove_dead_code(struct vsir_program *program) break; } } + + return VKD3D_OK; } static enum vkd3d_result vsir_program_normalise_combined_samplers(struct vsir_program *program, @@ -6681,12 +6684,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); + vsir_transform(&ctx, vsir_program_remove_dead_code); if (ctx.result < 0) return ctx.result; - remove_dead_code(program); - if ((result = vsir_program_normalise_combined_samplers(program, message_context)) < 0) return result;