mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Introduce function to clean up hlsl_derefs.
Signed-off-by: Francisco Casas <fcasas@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b9435fb1ff
commit
a7a4eb95e5
@ -621,6 +621,11 @@ static bool type_is_single_reg(const struct hlsl_type *type)
|
||||
return type->type == HLSL_CLASS_SCALAR || type->type == HLSL_CLASS_VECTOR;
|
||||
}
|
||||
|
||||
static void cleanup_deref(struct hlsl_deref *deref)
|
||||
{
|
||||
hlsl_src_remove(&deref->offset);
|
||||
}
|
||||
|
||||
struct hlsl_ir_store *hlsl_new_store(struct hlsl_ctx *ctx, struct hlsl_ir_var *var, struct hlsl_ir_node *offset,
|
||||
struct hlsl_ir_node *rhs, unsigned int writemask, struct vkd3d_shader_location loc)
|
||||
{
|
||||
@ -1579,7 +1584,7 @@ static void free_ir_jump(struct hlsl_ir_jump *jump)
|
||||
|
||||
static void free_ir_load(struct hlsl_ir_load *load)
|
||||
{
|
||||
hlsl_src_remove(&load->src.offset);
|
||||
cleanup_deref(&load->src);
|
||||
vkd3d_free(load);
|
||||
}
|
||||
|
||||
@ -1592,8 +1597,8 @@ static void free_ir_loop(struct hlsl_ir_loop *loop)
|
||||
static void free_ir_resource_load(struct hlsl_ir_resource_load *load)
|
||||
{
|
||||
hlsl_src_remove(&load->coords);
|
||||
hlsl_src_remove(&load->sampler.offset);
|
||||
hlsl_src_remove(&load->resource.offset);
|
||||
cleanup_deref(&load->sampler);
|
||||
cleanup_deref(&load->resource);
|
||||
hlsl_src_remove(&load->texel_offset);
|
||||
vkd3d_free(load);
|
||||
}
|
||||
@ -1601,7 +1606,7 @@ static void free_ir_resource_load(struct hlsl_ir_resource_load *load)
|
||||
static void free_ir_store(struct hlsl_ir_store *store)
|
||||
{
|
||||
hlsl_src_remove(&store->rhs);
|
||||
hlsl_src_remove(&store->lhs.offset);
|
||||
cleanup_deref(&store->lhs);
|
||||
vkd3d_free(store);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user