[Mesa-dev] [PATCH 3/5] glsl: Plumb through is_parameter to apply_type_qualifier_to_variable()

Matt Turner mattst88 at gmail.com
Wed Dec 19 13:55:41 PST 2012


On Wed, Dec 19, 2012 at 1:53 PM, Eric Anholt <eric at anholt.net> wrote:
> Matt Turner <mattst88 at gmail.com> writes:
>
>> On Wed, Dec 19, 2012 at 9:41 AM, Paul Berry <stereotype441 at gmail.com> wrote:
>>> On 19 December 2012 09:13, Matt Turner <mattst88 at gmail.com> wrote:
>>>>
>>>> On Wed, Dec 19, 2012 at 8:42 AM, Paul Berry <stereotype441 at gmail.com>
>>>> wrote:
>>>> > This patch adds logic to allow the ast_to_hir function
>>>> > apply_type_qualifier_to_variable() to tell whether it is acting on a
>>>> > variable declaration or a function parameter.  This will allow it to
>>>> > correctly interpret the meaning of "out" and "in" keywords (which have
>>>> > different meanings in those two contexts).
>>>> > ---
>>>> >  src/glsl/ast_to_hir.cpp | 7 ++++---
>>>> >  1 file changed, 4 insertions(+), 3 deletions(-)
>>>> >
>>>> > diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
>>>> > index 94b63f6..a14fe7d 100644
>>>> > --- a/src/glsl/ast_to_hir.cpp
>>>> > +++ b/src/glsl/ast_to_hir.cpp
>>>> > @@ -1915,7 +1915,8 @@ apply_type_qualifier_to_variable(const struct
>>>> > ast_type_qualifier *qual,
>>>> >                                  ir_variable *var,
>>>> >                                  struct _mesa_glsl_parse_state *state,
>>>> >                                  YYLTYPE *loc,
>>>> > -                                bool ubo_qualifiers_valid)
>>>> > +                                bool ubo_qualifiers_valid,
>>>> > +                                 bool is_parameter)
>>>>
>>>> Whitespace might be a little off here.
>>>
>>>
>>> It's actually fine--this is another case of the old "tabs vs spaces look
>>> different in diffs" problem.
>>
>> The problem seems to be that the whitespace before
>> ubo_qualifiers_valid is tabs, and the whitespace before is_parameter
>> is spaces. I don't think that's intentional?
>
> Basically, the tabs are my fault and Ian's (I think) from before we
> picked up the style that had been set down in 2006, and it's accepted
> for new code to follow that style even when the surrounding code doesn't
> follow it.

Okay, works for me. Maybe we should run the code through indent after
gles3 is merged.


More information about the mesa-dev mailing list