[PATCH vkd3d 4/5] vkd3d-shader/hlsl: Remove trivial swizzles after each copy prop pass.

Matteo Bruni matteo.mystral at gmail.com
Wed Mar 2 06:08:18 CST 2022


On Thu, Feb 24, 2022 at 4:05 PM Giovanni Mascellani
<gmascellani at codeweavers.com> wrote:
>
> Hi,
>
> Il 24/02/22 15:06, Matteo Bruni ha scritto:
> > --- a/libs/vkd3d-shader/hlsl_codegen.c
> > +++ b/libs/vkd3d-shader/hlsl_codegen.c
> > @@ -1665,9 +1665,9 @@ int hlsl_emit_dxbc(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_fun
> >       {
> >           progress = transform_ir(ctx, hlsl_fold_constants, body, NULL);
> >           progress |= copy_propagation_execute(ctx, body);
> > +        transform_ir(ctx, remove_trivial_swizzles, body, NULL);
>
> Wouldn't it make sense to "progress |=" this one too? I guess that
> removing a trivial swizzle can enable another round of constant folding
> or copy propagation.

I remember thinking about it and dismissing it. Problem is, I don't
know how I reached that conclusion.

I'll resend this patch with the change.



More information about the wine-devel mailing list