mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Factor out a variable_decl rule.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
19b21ed005
commit
58c80574d8
@@ -1973,6 +1973,7 @@ static struct list *add_constructor(struct hlsl_ctx *ctx, struct hlsl_type *type
|
|||||||
%type <type> typedef_type
|
%type <type> typedef_type
|
||||||
|
|
||||||
%type <variable_def> type_spec
|
%type <variable_def> type_spec
|
||||||
|
%type <variable_def> variable_decl
|
||||||
%type <variable_def> variable_def
|
%type <variable_def> variable_def
|
||||||
|
|
||||||
%%
|
%%
|
||||||
@@ -2546,7 +2547,7 @@ variables_def:
|
|||||||
list_add_tail($$, &$3->entry);
|
list_add_tail($$, &$3->entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
variable_def:
|
variable_decl:
|
||||||
any_identifier arrays colon_attribute
|
any_identifier arrays colon_attribute
|
||||||
{
|
{
|
||||||
$$ = hlsl_alloc(ctx, sizeof(*$$));
|
$$ = hlsl_alloc(ctx, sizeof(*$$));
|
||||||
@@ -2556,15 +2557,13 @@ variable_def:
|
|||||||
$$->semantic = $3.semantic;
|
$$->semantic = $3.semantic;
|
||||||
$$->reg_reservation = $3.reg_reservation;
|
$$->reg_reservation = $3.reg_reservation;
|
||||||
}
|
}
|
||||||
| any_identifier arrays colon_attribute '=' complex_initializer
|
|
||||||
|
variable_def:
|
||||||
|
variable_decl
|
||||||
|
| variable_decl '=' complex_initializer
|
||||||
{
|
{
|
||||||
$$ = hlsl_alloc(ctx, sizeof(*$$));
|
$$ = $1;
|
||||||
$$->loc = @1;
|
$$->initializer = $3;
|
||||||
$$->name = $1;
|
|
||||||
$$->arrays = $2;
|
|
||||||
$$->semantic = $3.semantic;
|
|
||||||
$$->reg_reservation = $3.reg_reservation;
|
|
||||||
$$->initializer = $5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
arrays:
|
arrays:
|
||||||
|
Reference in New Issue
Block a user