On Wed, Jul 29, 2009 at 7:34 PM, Ian Romanick<[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I've noticed an odd behavior in Mesa's current shader assembler.  Given
> a program like progs/vp/arl-static.txt, it will emit an error message
> but assemble and use the program.  Is this intentional?  Are there some
> real-world applications that use incorrect shaders that just happen to
> work on some implementations?
>
> The reason that I'm asking is my new assembler does not reproduce this
> behavior.  It adheres to the spec and rejects this program.
>
> In the code from arl-static.txt reproduced below, "arr[5]" should be
> "arr[7]".
>
> !!ARBvp1.0
> PARAM arr[5]  = { {.0,.1,.2,.3}, {.4,.5,.6,.7}, {.8,.9,.10,.1},
> {.12,.3,.4,.14}, {.5,.8,.1,.9},  {.2,0,.4,.1}, {.6,.1,.8,.9}};
> ADDRESS addr;
> ARL addr.x, {3}.x;
> MOV result.color, arr[addr.x];
> MOV result.position, vertex.position;
> END

The attached patch should fix this.  Please commit if you agree.

-Brian
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index bc65aba..4baacdf 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -2028,6 +2028,7 @@ parse_param (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head,
          program_error(ctx, Program->Position,
               "Declared parameter array length does not match parameter list");
       }
+      return 1;
    }
 
    (*inst)++;
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to