From: Conor McCarthy cmccarthy@codeweavers.com
We started with only one or two of these but it has become excessive. --- libs/vkd3d-shader/ir.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/libs/vkd3d-shader/ir.c b/libs/vkd3d-shader/ir.c index 4ee4076a7..3f8a6f192 100644 --- a/libs/vkd3d-shader/ir.c +++ b/libs/vkd3d-shader/ir.c @@ -1555,25 +1555,27 @@ enum vkd3d_result vkd3d_shader_normalise(struct vkd3d_shader_parser *parser, result = instruction_array_normalise_hull_shader_control_point_io(instructions, &parser->shader_desc.input_signature); } - if (result >= 0) - result = shader_normalise_io_registers(parser); + if (result < 0) + return result; + + if ((result = shader_normalise_io_registers(parser)) < 0) + return result;
- if (result >= 0) - result = instruction_array_normalise_flat_constants(parser); + if ((result = instruction_array_normalise_flat_constants(parser)) < 0) + return result;
- if (result >= 0) - remove_dead_code(parser); + remove_dead_code(parser);
- if (result >= 0) - result = normalise_combined_samplers(parser); + if ((result = normalise_combined_samplers(parser)) < 0) + return result;
- if (result >= 0 && TRACE_ON()) + if (TRACE_ON()) vkd3d_shader_trace(instructions, &parser->shader_version);
- if (result >= 0 && !parser->failed) - result = vsir_validate(parser); + if (!parser->failed && (result = vsir_validate(parser)) < 0) + return result;
- if (result >= 0 && parser->failed) + if (parser->failed) result = VKD3D_ERROR_INVALID_SHADER;
return result;