[Mesa-dev] [PATCH] glsl: Remove field array_lvalue from ir_variable.

Paul Berry stereotype441 at gmail.com
Tue Sep 13 09:25:33 PDT 2011


On 13 September 2011 07:17, Ian Romanick <idr at freedesktop.org> wrote:

>
> > *instructions, type = glsl_type::error_type; }
> >
> > +   /* From page 39 (page 45 of the PDF) of the GLSL 1.10 spec: +
> > * +    *    "When calling a function, expressions that do not
> > evaluate to +    *     l-values cannot be passed to parameters
> > declared as out or inout." +    * +    * From page 32 (page 38 of
> > the PDF) of the GLSL 1.10 spec: +    * +    *    "Other binary or
> > unary expressions, non-dereferenced arrays, +    *     function
> > names, swizzles with repeated fields, and constants +    *
> > cannot be l-values." +    * +    * So for GLSL 1.10, passing an
> > array as an out or inout parameter is not +    * allowed.  This
> > restriction is removed in GLSL 1.20, and in GLSL ES. +    */ +   if
> > ((var->mode == ir_var_inout || var->mode == ir_var_out) +       &&
> > type->is_array() && state->language_version == 110) { +
> > _mesa_glsl_error(&loc, state, "Arrays are not l-values in GLSL
> > 1.10");
>
> > /** @@ -2953,6 +2934,26 @@ ast_parameter_declarator::hir(exec_list
> The error message should say what the actual error is.  While this
> message is technically correct, it will confuse / irritate some
> people.  "Arrays cannot be out or inout parameters in GLSL 1.10" is
> better.
>

Agreed.  Your phrasing is better.  I'll fix it when I push the patch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110913/f1a5c59e/attachment.htm>


More information about the mesa-dev mailing list