[Mesa-dev] [PATCH 08/23] glsl: Add production for subroutine qualifier with type list

Dave Airlie airlied at gmail.com
Thu Apr 23 18:42:44 PDT 2015


From: Chris Forbes <chrisf at ijw.co.nz>

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 src/glsl/glsl_parser.yy | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 743cf26..97507eb 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -215,6 +215,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
 %type <type_qualifier> layout_qualifier_id_list layout_qualifier_id
 %type <type_qualifier> interface_block_layout_qualifier
 %type <type_qualifier> subroutine_qualifier
+%type <type_qualifier> subroutine_type_list
 %type <type_qualifier> interface_qualifier
 %type <type_specifier> type_specifier
 %type <type_specifier> type_specifier_nonarray
@@ -1554,6 +1555,23 @@ subroutine_qualifier:
       memset(& $$, 0, sizeof($$));
       $$.flags.q.subroutine = 1;
    }
+   | SUBROUTINE '(' subroutine_type_list ')'
+   {
+      memset(& $$, 0, sizeof($$));
+      $$.flags.q.subroutine = 1;
+      /* TODO: collect the type list from $3 */
+   }
+   ;
+
+subroutine_type_list:
+   any_identifier
+   {
+      /* TODO */
+   }
+   | subroutine_type_list ',' any_identifier
+   {
+      /* TODO */
+   }
    ;
 
 interpolation_qualifier:
-- 
2.1.0



More information about the mesa-dev mailing list