mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Handle loops in copy propagation.
Signed-off-by: Giovanni Mascellani <gmascellani@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
ec85eb538b
commit
e6ce077ad4
@ -634,6 +634,21 @@ static bool copy_propagation_process_if(struct hlsl_ctx *ctx, struct hlsl_ir_if
|
|||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool copy_propagation_process_loop(struct hlsl_ctx *ctx, struct hlsl_ir_loop *loop,
|
||||||
|
struct copy_propagation_state *state)
|
||||||
|
{
|
||||||
|
struct copy_propagation_state inner_state;
|
||||||
|
bool progress = false;
|
||||||
|
|
||||||
|
copy_propagation_invalidate_from_block(ctx, state, &loop->body);
|
||||||
|
|
||||||
|
copy_propagation_state_init(ctx, &inner_state, state);
|
||||||
|
progress |= copy_propagation_transform_block(ctx, &loop->body, &inner_state);
|
||||||
|
copy_propagation_state_destroy(&inner_state);
|
||||||
|
|
||||||
|
return progress;
|
||||||
|
}
|
||||||
|
|
||||||
static bool copy_propagation_transform_block(struct hlsl_ctx *ctx, struct hlsl_block *block,
|
static bool copy_propagation_transform_block(struct hlsl_ctx *ctx, struct hlsl_block *block,
|
||||||
struct copy_propagation_state *state)
|
struct copy_propagation_state *state)
|
||||||
{
|
{
|
||||||
@ -661,8 +676,8 @@ static bool copy_propagation_transform_block(struct hlsl_ctx *ctx, struct hlsl_b
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HLSL_IR_LOOP:
|
case HLSL_IR_LOOP:
|
||||||
FIXME("Copy propagation doesn't support loops yet, leaving.\n");
|
progress |= copy_propagation_process_loop(ctx, hlsl_ir_loop(instr), state);
|
||||||
return progress;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user