[PATCH vkd3d 3.5/5] vkd3d-shader: Consider previous last_read value when computing liveness.
Matteo Bruni
matteo.mystral at gmail.com
Mon Mar 22 14:41:34 CDT 2021
On Sun, Mar 21, 2021 at 9:54 PM Zebediah Figura (she/her)
<zfigura at codeweavers.com> wrote:
>
> On 3/21/21 3:40 PM, Matteo Bruni wrote:
> > Otherwise we end up overwriting UINT_MAX last_read for output variables.
> >
> > Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
> > ---
> > libs/vkd3d-shader/hlsl_codegen.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c
> > index b6b9ded..b9f753a 100644
> > --- a/libs/vkd3d-shader/hlsl_codegen.c
> > +++ b/libs/vkd3d-shader/hlsl_codegen.c
> > @@ -355,7 +355,7 @@ static void compute_liveness_recurse(struct list *instrs, unsigned int loop_firs
> > struct hlsl_ir_load *load = hlsl_ir_load(instr);
> >
> > var = load->src.var;
> > - var->last_read = loop_last ? max(instr->index, loop_last) : instr->index;
> > + var->last_read = max(var->last_read, loop_last ? max(instr->index, loop_last) : instr->index);
> > if (load->src.offset.node)
> > load->src.offset.node->last_read = instr->index;
> > break;
> >
>
> This works, though I guess the other option is to assign UINT_MAX after
> calling compute_liveness_recurse().
Yeah, I'm not particularly attached to this specific fix. Feel free to
change it however you see fit.
More information about the wine-devel
mailing list