mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Add functions to the global list inside the func_prototype rule.
This commit is contained in:
parent
4c46075d86
commit
77d716c811
Notes:
Alexandre Julliard
2023-02-07 22:15:32 +01:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/77
@ -77,7 +77,6 @@ struct parse_variable_def
|
|||||||
|
|
||||||
struct parse_function
|
struct parse_function
|
||||||
{
|
{
|
||||||
char *name;
|
|
||||||
struct hlsl_ir_function_decl *decl;
|
struct hlsl_ir_function_decl *decl;
|
||||||
struct hlsl_func_parameters parameters;
|
struct hlsl_func_parameters parameters;
|
||||||
struct hlsl_semantic return_semantic;
|
struct hlsl_semantic return_semantic;
|
||||||
@ -3690,7 +3689,6 @@ static bool add_method_call(struct hlsl_ctx *ctx, struct list *instrs, struct hl
|
|||||||
%type <fields> field
|
%type <fields> field
|
||||||
%type <fields> fields_list
|
%type <fields> fields_list
|
||||||
|
|
||||||
%type <function> func_declaration
|
|
||||||
%type <function> func_prototype
|
%type <function> func_prototype
|
||||||
%type <function> func_prototype_no_attrs
|
%type <function> func_prototype_no_attrs
|
||||||
|
|
||||||
@ -3733,17 +3731,6 @@ static bool add_method_call(struct hlsl_ctx *ctx, struct list *instrs, struct hl
|
|||||||
hlsl_prog:
|
hlsl_prog:
|
||||||
%empty
|
%empty
|
||||||
| hlsl_prog func_declaration
|
| hlsl_prog func_declaration
|
||||||
{
|
|
||||||
if ($2.first)
|
|
||||||
{
|
|
||||||
hlsl_add_function(ctx, $2.name, $2.decl);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vkd3d_free($2.parameters.vars);
|
|
||||||
hlsl_cleanup_semantic(&$2.return_semantic);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
| hlsl_prog buffer_declaration buffer_body
|
| hlsl_prog buffer_declaration buffer_body
|
||||||
| hlsl_prog declaration_statement
|
| hlsl_prog declaration_statement
|
||||||
{
|
{
|
||||||
@ -4035,11 +4022,14 @@ func_declaration:
|
|||||||
}
|
}
|
||||||
hlsl_pop_scope(ctx);
|
hlsl_pop_scope(ctx);
|
||||||
|
|
||||||
$$ = $1;
|
if (!$1.first)
|
||||||
|
{
|
||||||
|
vkd3d_free($1.parameters.vars);
|
||||||
|
hlsl_cleanup_semantic(&$1.return_semantic);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
| func_prototype ';'
|
| func_prototype ';'
|
||||||
{
|
{
|
||||||
$$ = $1;
|
|
||||||
hlsl_pop_scope(ctx);
|
hlsl_pop_scope(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4146,9 +4136,10 @@ func_prototype_no_attrs:
|
|||||||
{
|
{
|
||||||
if (!($$.decl = hlsl_new_func_decl(ctx, type, &$5, &$7.semantic, &@3)))
|
if (!($$.decl = hlsl_new_func_decl(ctx, type, &$5, &$7.semantic, &@3)))
|
||||||
YYABORT;
|
YYABORT;
|
||||||
$$.name = $3;
|
|
||||||
ctx->cur_function = $$.decl;
|
ctx->cur_function = $$.decl;
|
||||||
|
|
||||||
|
hlsl_add_function(ctx, $3, $$.decl);
|
||||||
|
|
||||||
$$.first = true;
|
$$.first = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ float4 main() : sv_target
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[pixel shader notimpl todo]
|
[pixel shader notimpl]
|
||||||
|
|
||||||
% Even trivially finite recursion is forbidden.
|
% Even trivially finite recursion is forbidden.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user