From 675d7b8cb64d5ad5afb51d3a1f034ae3aba5c3e2 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 26 Jan 2024 15:59:49 -0600 Subject: [PATCH] vkd3d-shader/hlsl: Remove a redundant type check. We already perform an implicit cast per component in initialize_var_components(). --- libs/vkd3d-shader/hlsl.y | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 52c21765..17bb565d 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -4358,22 +4358,7 @@ static struct hlsl_block *add_constructor(struct hlsl_ctx *ctx, struct hlsl_type return NULL; for (i = 0; i < params->args_count; ++i) - { - struct hlsl_ir_node *arg = params->args[i]; - - if (arg->data_type->class == HLSL_CLASS_OBJECT) - { - struct vkd3d_string_buffer *string; - - if ((string = hlsl_type_to_string(ctx, arg->data_type))) - hlsl_error(ctx, &arg->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE, - "Invalid type %s for constructor argument.", string->buffer); - hlsl_release_string_buffer(ctx, string); - continue; - } - - initialize_var_components(ctx, params->instrs, var, &idx, arg); - } + initialize_var_components(ctx, params->instrs, var, &idx, params->args[i]); if (!(load = hlsl_new_var_load(ctx, var, loc))) return NULL;