[Mesa-dev] [PATCH] glsl: Clarify error message about whole-array assignment in GLSL 1.10.

Paul Berry stereotype441 at gmail.com
Thu Sep 8 19:41:28 PDT 2011

On 8 September 2011 18:06, Eric Anholt <eric at anholt.net> wrote:

> On Thu, 08 Sep 2011 12:57:31 -0700, Ian Romanick <idr at freedesktop.org>
> wrote:
> > Hash: SHA1
> >
> > On 09/07/2011 12:51 PM, Eric Anholt wrote:
> > > Previously, it would produce:
> > >
> > > Failed to compile FS: 0:6(7): error: non-lvalue in assignment
> > >
> > > and now it produces:
> > >
> > > Failed to compile FS: 0:5(7): error: whole array assignment is not
> > > allowed in GLSL 1.10 or GLSL ES 1.00.
> > >
> > > Also, add spec quotation to the two places we have code for array
> > > lvalues in GLSL 1.10.
> >
> > There are two places in the code that use is_lvalue.  One is in
> > do_assignment, and the other is in match_function_by_name (for out and
> > inout parameters).  Since we've already special case handle whole
> > arrays in do_assignment, I think we should do the same in
> > match_function_by_name and remove array_lvalue.
> >
> > In particular, I think we should check that out and inout parameters
> > can be arrays when processing the function prototype.  That should be
> > valid (and "just work") in everything except desktop GLSL 1.10.  Right?
> >
> > That may be a reasonable thing to do as a follow-on patch...

Call me crazy, but I would have sworn that we agreed on this plan when the
three of us talked in person on Wednesday.  In any case, I'm glad to have
the discussion on list, and I agree 100% with this plan.  Some of my work on
gl_ClipDistance is currently blocked because array_lvalue is set incorrectly
for built-in arrays, and Ian's proposal for eliminating array_lvalue seems
like the best way to fix it.

> Paul said he needed to do some work on array_lvalue, so I'm leaving that
> up to him in a followup patch.  I do agree that just doing it in
> function parameter handling sounds better than the way we've got it
> wired up today.

I don't have any work I need to do on array_lvalue other than the work we
are discussing in this thread.  I currently have the greatest need for this
change (since it's blocking my gl_ClipDistance work) so I'll take it as my
task unless I hear otherwise.  But if either of the two of you would rather
do it just say so--you both are way more familiar with the code base than I
am and can probably do it much faster than I can.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110908/e10c8605/attachment.htm>

More information about the mesa-dev mailing list