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

Brian Paul brian.e.paul at gmail.com
Wed Aug 11 18:34:45 PDT 2010

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.


More information about the mesa-dev mailing list