[Mesa-dev] [PATCH 05/32] glsl: Parse non-array uniform block instance names in GLSL ES 3.00.

Chad Versace chad.versace at linux.intel.com
Thu Jan 24 16:19:47 PST 2013


On 01/23/2013 01:43 PM, Paul Berry wrote:
> On 22 January 2013 00:51, Ian Romanick <idr at freedesktop.org> wrote:
> 
>> From: Kenneth Graunke <kenneth at whitecape.org>
>>
>> In GLSL ES 3.00 (and GLSL 1.50), uniform blocks can have an associated
>> "instance name", which essentially namespaces the variables inside.
>>
>> This patch adds basic parsing for this new feature, but doesn't yet hook
>> it up to actually do anything yet.
>>
>> It does not support for arrays of interface blocks; a later commit will
>> take care of that.
>>
>> This change temporarily regresses the piglit test
>> interface-name-access-without-interface-name.vert.  This shader failed
>> to compile before (the expected result), but it failed to compile for
>> the wrong reason.  This is not a real regression.
>> ---
>>  src/glsl/ast.h          |  6 ++++--
>>  src/glsl/glsl_parser.yy | 20 ++++++++++++++++++--
>>  2 files changed, 22 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/glsl/ast.h b/src/glsl/ast.h
>> index 5074782..bcec6bb 100644
>> --- a/src/glsl/ast.h
>> +++ b/src/glsl/ast.h
>> @@ -805,8 +805,9 @@ class ast_uniform_block : public ast_node {
>>  public:
>>     ast_uniform_block(ast_type_qualifier layout,
>>                      const char *block_name,
>> -                    ast_declarator_list *member_list)
>> -   : layout(layout), block_name(block_name)
>> +                    ast_declarator_list *member_list,
>> +                     const char *instance_name)
>> +   : layout(layout), block_name(block_name), instance_name(instance_name)
>>     {
>>        declarations.push_degenerate_list_at_head(&member_list->link);
>>     }
>> @@ -816,6 +817,7 @@ public:
>>
>>     ast_type_qualifier layout;
>>     const char *block_name;
>> +   const char *instance_name;
>>
> 
> It would be nice to have a comment above this field explaining that
> instance_name is NULL if there is no instance name.


I second the need for a comment here.

With that,
Reviewed-by: Chad Versace <chad.versace at linux.intel.com>



More information about the mesa-dev mailing list