vkd3d-shader/hlsl: Return a node from lower_ir().

This allows us to use the same function for "folding" passes, which usually
replace with a node other than the last one added in a block.
This commit is contained in:
Elizabeth Figura
2025-08-20 17:01:40 -05:00
committed by Henri Verbeet
parent b1672fd3fe
commit be31842197
Notes: Henri Verbeet 2025-10-09 15:57:34 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1749
3 changed files with 252 additions and 287 deletions

View File

@@ -2205,11 +2205,11 @@ static struct hlsl_ir_node *hlsl_new_resource_store(struct hlsl_ctx *ctx,
return &store->node;
}
void hlsl_block_add_resource_store(struct hlsl_ctx *ctx, struct hlsl_block *block,
struct hlsl_ir_node *hlsl_block_add_resource_store(struct hlsl_ctx *ctx, struct hlsl_block *block,
enum hlsl_resource_store_type type, const struct hlsl_deref *resource, struct hlsl_ir_node *coords,
struct hlsl_ir_node *value, uint32_t writemask, const struct vkd3d_shader_location *loc)
{
append_new_instr(ctx, block, hlsl_new_resource_store(ctx, type, resource, coords, value, writemask, loc));
return append_new_instr(ctx, block, hlsl_new_resource_store(ctx, type, resource, coords, value, writemask, loc));
}
struct hlsl_ir_node *hlsl_new_swizzle(struct hlsl_ctx *ctx, uint32_t s, unsigned int component_count,

View File

@@ -1599,7 +1599,7 @@ void hlsl_block_add_loop(struct hlsl_ctx *ctx, struct hlsl_block *block,
unsigned int unroll_limit, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_block_add_resource_load(struct hlsl_ctx *ctx, struct hlsl_block *block,
const struct hlsl_resource_load_params *params, const struct vkd3d_shader_location *loc);
void hlsl_block_add_resource_store(struct hlsl_ctx *ctx, struct hlsl_block *block,
struct hlsl_ir_node *hlsl_block_add_resource_store(struct hlsl_ctx *ctx, struct hlsl_block *block,
enum hlsl_resource_store_type type, const struct hlsl_deref *resource, struct hlsl_ir_node *coords,
struct hlsl_ir_node *value, uint32_t writemask, const struct vkd3d_shader_location *loc);
struct hlsl_ir_node *hlsl_block_add_simple_load(struct hlsl_ctx *ctx, struct hlsl_block *block,

File diff suppressed because it is too large Load Diff