mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Replace register offsets with index paths in split copies.
hlsl_new_store() and hlsl_new_load() are deleted, so now there are no more direct ways to create derefs with offsets in hlsl.c and hlsl.h. Signed-off-by: Francisco Casas <fcasas@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
d7d2fe145f
commit
577014c017
Notes:
Alexandre Julliard
2022-10-18 00:13:00 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/5
@@ -797,25 +797,6 @@ void hlsl_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)
|
||||
{
|
||||
struct hlsl_ir_store *store;
|
||||
|
||||
if (!writemask && type_is_single_reg(rhs->data_type))
|
||||
writemask = (1 << rhs->data_type->dimx) - 1;
|
||||
|
||||
if (!(store = hlsl_alloc(ctx, sizeof(*store))))
|
||||
return NULL;
|
||||
|
||||
init_node(&store->node, HLSL_IR_STORE, NULL, loc);
|
||||
init_deref(ctx, &store->lhs, var, 0);
|
||||
hlsl_src_from_node(&store->lhs.offset, offset);
|
||||
hlsl_src_from_node(&store->rhs, rhs);
|
||||
store->writemask = writemask;
|
||||
return store;
|
||||
}
|
||||
|
||||
/* Initializes a simple variable derefence, so that it can be passed to load/store functions. */
|
||||
void hlsl_init_simple_deref_from_var(struct hlsl_deref *deref, struct hlsl_ir_var *var)
|
||||
{
|
||||
@@ -971,19 +952,6 @@ struct hlsl_ir_if *hlsl_new_if(struct hlsl_ctx *ctx, struct hlsl_ir_node *condit
|
||||
return iff;
|
||||
}
|
||||
|
||||
struct hlsl_ir_load *hlsl_new_load(struct hlsl_ctx *ctx, struct hlsl_ir_var *var, struct hlsl_ir_node *offset,
|
||||
struct hlsl_type *type, const struct vkd3d_shader_location loc)
|
||||
{
|
||||
struct hlsl_ir_load *load;
|
||||
|
||||
if (!(load = hlsl_alloc(ctx, sizeof(*load))))
|
||||
return NULL;
|
||||
init_node(&load->node, HLSL_IR_LOAD, type, loc);
|
||||
init_deref(ctx, &load->src, var, 0);
|
||||
hlsl_src_from_node(&load->src.offset, offset);
|
||||
return load;
|
||||
}
|
||||
|
||||
struct hlsl_ir_load *hlsl_new_load_index(struct hlsl_ctx *ctx, const struct hlsl_deref *deref,
|
||||
struct hlsl_ir_node *idx, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user