[Mesa-dev] [PATCH] Mesa prog_optimize.c: better optimization for Mesa programs

Segovia, Benjamin benjamin.segovia at intel.com
Wed Aug 11 20:21:59 PDT 2010


I rescaned the whole code and tried to perform more aggressive checks.
I rerun all the tests, warsow and nexuiz.

Please find the updated patch attached.


From: Brian Paul [brian.e.paul at gmail.com]
Sent: Wednesday, August 11, 2010 7:34 PM
To: Segovia, Benjamin
Cc: mesa-dev at lists.freedesktop.org
Subject: Re: [Mesa-dev] [PATCH] Mesa prog_optimize.c: better optimization for   Mesa programs

On Wed, Aug 11, 2010 at 7:12 PM, Brian Paul <brian.e.paul at gmail.com> wrote:
> I'm just reviewing the patch again and doing some testing.  I'll
> probably commit it soon.  Thanks.

I found a problem.  I was going through the code and added a few new
assertions.  At line 526 or so we use the loop counter 'arg' after the
loop.  Its value is 3 at this point but the largest legal value for
get_src_arg_mask() is 2.  The new assertion I added here fails with
glean's glsl1 test.

         if (inst2->DstReg.File == mov->DstReg.File &&
             (inst2->DstReg.RelAddr ||
              inst2->DstReg.Index == mov->DstReg.Index)) {
            dst_mask &= ~inst2->DstReg.WriteMask;
            assert(arg < 3);
            src_mask = get_src_arg_mask(inst2, arg, dst_mask);

Can you look into that?  Maybe you should scan the code and see if
additional assertions could be made.  Thanks.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: better_prog_optimize2.patch
Type: application/octet-stream
Size: 27406 bytes
Desc: better_prog_optimize2.patch
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100811/fa93ce68/attachment-0001.obj>

More information about the mesa-dev mailing list