vkd3d-shader/hlsl: Add a hlsl_block_add_resource_store() helper.

This commit is contained in:
Elizabeth Figura
2024-12-09 16:31:02 -06:00
committed by Henri Verbeet
parent e7ff5da5b1
commit f4042ba752
Notes: Henri Verbeet 2025-03-10 15:23:02 +01:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1404
3 changed files with 12 additions and 18 deletions

View File

@@ -1978,7 +1978,7 @@ struct hlsl_ir_node *hlsl_new_resource_load(struct hlsl_ctx *ctx,
return &load->node;
}
struct hlsl_ir_node *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource,
static struct hlsl_ir_node *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct hlsl_deref *resource,
struct hlsl_ir_node *coords, struct hlsl_ir_node *value, const struct vkd3d_shader_location *loc)
{
struct hlsl_ir_resource_store *store;
@@ -1992,6 +1992,12 @@ struct hlsl_ir_node *hlsl_new_resource_store(struct hlsl_ctx *ctx, const struct
return &store->node;
}
void hlsl_block_add_resource_store(struct hlsl_ctx *ctx, struct hlsl_block *block, const struct hlsl_deref *resource,
struct hlsl_ir_node *coords, struct hlsl_ir_node *value, const struct vkd3d_shader_location *loc)
{
append_new_instr(ctx, block, hlsl_new_resource_store(ctx, resource, coords, value, loc));
}
struct hlsl_ir_node *hlsl_new_swizzle(struct hlsl_ctx *ctx, uint32_t s, unsigned int component_count,
struct hlsl_ir_node *val, const struct vkd3d_shader_location *loc)
{