vkd3d-shader/hlsl: Use replace_ir() for hlsl_fold_constant_exprs().

This commit is contained in:
Elizabeth Figura
2025-08-20 17:50:53 -05:00
committed by Henri Verbeet
parent 6e8eeb8f7a
commit 1f40222a0d
Notes: Henri Verbeet 2025-10-28 16:58:15 +01:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1794
3 changed files with 9 additions and 12 deletions

View File

@@ -8470,7 +8470,7 @@ static bool simplify_exprs(struct hlsl_ctx *ctx, struct hlsl_block *block)
do
{
progress = hlsl_transform_ir(ctx, hlsl_fold_constant_exprs, block, NULL);
progress = replace_ir(ctx, hlsl_fold_constant_exprs, block);
progress |= hlsl_transform_ir(ctx, hlsl_normalize_binary_exprs, block, NULL);
progress |= hlsl_transform_ir(ctx, fold_unary_identities, block, NULL);
progress |= hlsl_transform_ir(ctx, fold_conditional_identities, block, NULL);
@@ -14849,7 +14849,7 @@ static void process_entry_function(struct hlsl_ctx *ctx, struct list *semantic_v
replace_ir(ctx, lower_int_modulus_sm1, body);
replace_ir(ctx, lower_division, body);
/* Constants casted to float must be folded, and new casts to bool also need to be lowered. */
hlsl_transform_ir(ctx, hlsl_fold_constant_exprs, body, NULL);
replace_ir(ctx, hlsl_fold_constant_exprs, body);
replace_ir(ctx, lower_casts_to_bool, body);
replace_ir(ctx, lower_casts_to_int, body);