vkd3d-shader/ir: Run validation after normalising flat constants.

This commit is contained in:
Giovanni Mascellani 2024-09-05 17:29:30 +02:00 committed by Henri Verbeet
parent 1c285d40bd
commit 828dfdf1bd
Notes: Henri Verbeet 2024-09-10 21:57:30 +02:00
Approved-by: Conor McCarthy (@cmccarthy)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1049

View File

@ -1913,7 +1913,8 @@ static void shader_register_normalise_flat_constants(struct vkd3d_shader_src_par
param->reg.idx_count = 3; 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}; struct flat_constants_normaliser normaliser = {0};
unsigned int i, j; 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_io_registers);
vsir_transform(&ctx, vsir_program_normalise_flat_constants);
if (ctx.result < 0) if (ctx.result < 0)
return ctx.result; return ctx.result;
if ((result = instruction_array_normalise_flat_constants(program)) < 0)
return result;
remove_dead_code(program); remove_dead_code(program);
if ((result = vsir_program_normalise_combined_samplers(program, message_context)) < 0) if ((result = vsir_program_normalise_combined_samplers(program, message_context)) < 0)