From ec85eb538b372da07fcb028d67c595e6c4f2727e Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 3 May 2022 11:57:17 +0200 Subject: [PATCH] vkd3d-shader/hlsl: Remove the location parameter from initialize_var_components(). Signed-off-by: Giovanni Mascellani Signed-off-by: Francisco Casas Signed-off-by: Henri Verbeet Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- libs/vkd3d-shader/hlsl.y | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index e518430f..44e4964f 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -1536,8 +1536,7 @@ static bool add_increment(struct hlsl_ctx *ctx, struct list *instrs, bool decrem } static void initialize_var_components(struct hlsl_ctx *ctx, struct list *instrs, - struct hlsl_ir_var *dst, unsigned int *store_index, struct hlsl_ir_node *src, - const struct vkd3d_shader_location *loc) + struct hlsl_ir_var *dst, unsigned int *store_index, struct hlsl_ir_node *src) { unsigned int src_comp_count = hlsl_type_component_count(src->data_type); unsigned int k; @@ -1554,21 +1553,21 @@ static void initialize_var_components(struct hlsl_ctx *ctx, struct list *instrs, dst_reg_offset = hlsl_compute_component_offset(ctx, dst->data_type, *store_index, &dst_comp_type); src_reg_offset = hlsl_compute_component_offset(ctx, src->data_type, k, &src_comp_type); - if (!(c = hlsl_new_uint_constant(ctx, src_reg_offset, loc))) + if (!(c = hlsl_new_uint_constant(ctx, src_reg_offset, &src->loc))) return; list_add_tail(instrs, &c->node.entry); - if (!(load = add_load(ctx, instrs, src, &c->node, src_comp_type, *loc))) + if (!(load = add_load(ctx, instrs, src, &c->node, src_comp_type, src->loc))) return; - if (!(conv = add_implicit_conversion(ctx, instrs, &load->node, dst_comp_type, loc))) + if (!(conv = add_implicit_conversion(ctx, instrs, &load->node, dst_comp_type, &src->loc))) return; - if (!(c = hlsl_new_uint_constant(ctx, dst_reg_offset, loc))) + if (!(c = hlsl_new_uint_constant(ctx, dst_reg_offset, &src->loc))) return; list_add_tail(instrs, &c->node.entry); - if (!(store = hlsl_new_store(ctx, dst, &c->node, conv, 0, *loc))) + if (!(store = hlsl_new_store(ctx, dst, &c->node, conv, 0, src->loc))) return; list_add_tail(instrs, &store->node.entry); @@ -1716,7 +1715,7 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t for (k = 0; k < v->initializer.args_count; ++k) { initialize_var_components(ctx, v->initializer.instrs, var, - &store_index, v->initializer.args[k], &v->initializer.args[k]->loc); + &store_index, v->initializer.args[k]); } } else @@ -2049,7 +2048,7 @@ static struct list *add_constructor(struct hlsl_ctx *ctx, struct hlsl_type *type continue; } - initialize_var_components(ctx, params->instrs, var, &idx, arg, &arg->loc); + initialize_var_components(ctx, params->instrs, var, &idx, arg); } if (!(load = hlsl_new_var_load(ctx, var, loc)))