[Mesa-dev] [PATCH] mesa/prog: relative offsets into constbufs are not constant

Ilia Mirkin imirkin at alum.mit.edu
Wed Jul 1 16:30:57 PDT 2015


Ian, looks like you added this code back in antiquity...

commit 54c48a95e6e0573886433f94ac83293876ffe03d
Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Thu Feb 10 15:48:27 2011 -0800

    mesa: Add partial constant propagation pass for Mesa IR

On Wed, Jul 1, 2015 at 6:22 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> The optimization logic relies on being able to read out constbuf values
> from program parameters. However that only works if there's no relative
> addressing involved.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91173
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/mesa/program/prog_opt_constant_fold.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/mesa/program/prog_opt_constant_fold.c b/src/mesa/program/prog_opt_constant_fold.c
> index 3811c0d..e2518e6 100644
> --- a/src/mesa/program/prog_opt_constant_fold.c
> +++ b/src/mesa/program/prog_opt_constant_fold.c
> @@ -38,6 +38,8 @@ src_regs_are_constant(const struct prog_instruction *inst, unsigned num_srcs)
>     for (i = 0; i < num_srcs; i++) {
>        if (inst->SrcReg[i].File != PROGRAM_CONSTANT)
>          return false;
> +      if (inst->SrcReg[i].RelAddr)
> +         return false;
>     }
>
>     return true;
> --
> 2.3.6
>


More information about the mesa-dev mailing list