vkd3d-shader/hlsl: Store a non-constant hlsl_ir_function_decl pointer in struct hlsl_ir_call.

This commit is contained in:
Zebediah Figura 2023-01-16 13:14:09 -06:00 committed by Alexandre Julliard
parent 447463e590
commit 521f22e57a
Notes: Alexandre Julliard 2023-01-19 22:45:50 +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/63
3 changed files with 7 additions and 7 deletions

View File

@ -931,7 +931,7 @@ struct hlsl_ir_store *hlsl_new_store_component(struct hlsl_ctx *ctx, struct hlsl
return store;
}
struct hlsl_ir_node *hlsl_new_call(struct hlsl_ctx *ctx, const struct hlsl_ir_function_decl *decl,
struct hlsl_ir_node *hlsl_new_call(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *decl,
const struct vkd3d_shader_location *loc)
{
struct hlsl_ir_call *call;

View File

@ -420,7 +420,7 @@ struct hlsl_ir_function_decl
struct hlsl_ir_call
{
struct hlsl_ir_node node;
const struct hlsl_ir_function_decl *decl;
struct hlsl_ir_function_decl *decl;
};
struct hlsl_ir_if
@ -983,7 +983,7 @@ struct hlsl_ir_node *hlsl_new_binary_expr(struct hlsl_ctx *ctx, enum hlsl_ir_exp
struct hlsl_ir_constant *hlsl_new_bool_constant(struct hlsl_ctx *ctx, bool b, const struct vkd3d_shader_location *loc);
struct hlsl_buffer *hlsl_new_buffer(struct hlsl_ctx *ctx, enum hlsl_buffer_type type, const char *name,
const struct hlsl_reg_reservation *reservation, struct vkd3d_shader_location loc);
struct hlsl_ir_node *hlsl_new_call(struct hlsl_ctx *ctx, const struct hlsl_ir_function_decl *decl,
struct hlsl_ir_node *hlsl_new_call(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *decl,
const struct vkd3d_shader_location *loc);
struct hlsl_ir_expr *hlsl_new_cast(struct hlsl_ctx *ctx, struct hlsl_ir_node *node, struct hlsl_type *type,
const struct vkd3d_shader_location *loc);

View File

@ -2217,12 +2217,12 @@ static struct list *declare_vars(struct hlsl_ctx *ctx, struct hlsl_type *basic_t
struct find_function_call_args
{
const struct parse_initializer *params;
const struct hlsl_ir_function_decl *decl;
struct hlsl_ir_function_decl *decl;
};
static void find_function_call_exact(struct rb_entry *entry, void *context)
{
const struct hlsl_ir_function_decl *decl = RB_ENTRY_VALUE(entry, const struct hlsl_ir_function_decl, entry);
struct hlsl_ir_function_decl *decl = RB_ENTRY_VALUE(entry, struct hlsl_ir_function_decl, entry);
struct find_function_call_args *args = context;
const struct hlsl_ir_var *param;
unsigned int i = 0;
@ -2237,7 +2237,7 @@ static void find_function_call_exact(struct rb_entry *entry, void *context)
args->decl = decl;
}
static const struct hlsl_ir_function_decl *find_function_call(struct hlsl_ctx *ctx,
static struct hlsl_ir_function_decl *find_function_call(struct hlsl_ctx *ctx,
const char *name, const struct parse_initializer *params)
{
struct find_function_call_args args = {.params = params};
@ -2949,8 +2949,8 @@ static int intrinsic_function_name_compare(const void *a, const void *b)
static struct list *add_call(struct hlsl_ctx *ctx, const char *name,
struct parse_initializer *args, const struct vkd3d_shader_location *loc)
{
const struct hlsl_ir_function_decl *decl;
struct intrinsic_function *intrinsic;
struct hlsl_ir_function_decl *decl;
if ((decl = find_function_call(ctx, name, args)))
{