[Mesa-dev] [PATCH] Mesa prog_optimize.c: solve glsl2 regression

Ian Romanick idr at freedesktop.org
Tue Aug 17 12:09:32 PDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Benjamin Segovia wrote:
> - In one optimization pass, register files may have been messed therefore
>   merging instructions which use the same index in two different register files
> 
> - The fix consists in only processing temporary registers as it must be

I was just getting ready to commit this patch, but it seems the test
case is already fixed.  Something in Eric's commit below makes the
problem in glsl-vs-mat-mul-1 go away.

commit 62383ae6fe5d2ca092e8f9d8dae2ba9562e03d95
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jul 8 17:05:42 2010 -0700

    i965: Add disasm for Compr4 instruction compression.

Do you think your patch is still necessary?

> ---
>  src/mesa/program/prog_optimize.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/src/mesa/program/prog_optimize.c b/src/mesa/program/prog_optimize.c
> index ab87875..0dc7790 100644
> --- a/src/mesa/program/prog_optimize.c
> +++ b/src/mesa/program/prog_optimize.c
> @@ -758,7 +758,11 @@ _mesa_remove_extra_moves(struct gl_program *prog)
>           nesting--;
>           break;
>        case OPCODE_MOV:
> -         if (i > 0 && can_downward_mov_be_modifed(mov) && nesting == 0) {
> +         if (i > 0 &&
> +             can_downward_mov_be_modifed(mov) &&
> +             mov->SrcReg[0].File == PROGRAM_TEMPORARY &&
> +             nesting == 0)
> +         {
>  
>              /* see if this MOV can be removed */
>              const GLuint id = mov->SrcReg[0].Index;

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxq3msACgkQX1gOwKyEAw8coQCfQpxPW06XRV+sCdOKQFrcZ0Z4
xEUAn2JJOsFzXhZ79ncVaEDxmaLMTEnz
=dXdB
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list