mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Use hlsl_new_synthetic_var() in hlsl_new_func_decl().
This commit is contained in:
parent
1019bbead6
commit
da56f41ceb
Notes:
Alexandre Julliard
2022-11-08 23:05:16 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/43
@ -1193,17 +1193,12 @@ struct hlsl_ir_function_decl *hlsl_new_func_decl(struct hlsl_ctx *ctx, struct hl
|
||||
|
||||
if (!hlsl_types_are_equal(return_type, ctx->builtin_types.Void))
|
||||
{
|
||||
struct hlsl_ir_var *return_var;
|
||||
char name[28];
|
||||
|
||||
sprintf(name, "<retval-%p>", decl);
|
||||
if (!(return_var = hlsl_new_var(ctx, hlsl_strdup(ctx, name), return_type, loc, semantic, 0, NULL)))
|
||||
if (!(decl->return_var = hlsl_new_synthetic_var(ctx, "retval", return_type, &loc)))
|
||||
{
|
||||
vkd3d_free(decl);
|
||||
return NULL;
|
||||
}
|
||||
list_add_tail(&ctx->globals->vars, &return_var->scope_entry);
|
||||
decl->return_var = return_var;
|
||||
decl->return_var->semantic = *semantic;
|
||||
}
|
||||
|
||||
return decl;
|
||||
|
Loading…
Reference in New Issue
Block a user