diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-11-07 15:51:10 -0700 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-11-07 15:51:10 -0700 |
commit | 448156f769ebf271a6a8c03c61588c3e6c6363f0 (patch) | |
tree | 360ac5045c88500d122a8d41586338037c308ce9 /src/mesa/shader/slang/library/slang_shader.syn | |
parent | b632e5aa7f948ed5bbf7104682ec3ee463af4c0a (diff) | |
download | external_mesa3d-448156f769ebf271a6a8c03c61588c3e6c6363f0.zip external_mesa3d-448156f769ebf271a6a8c03c61588c3e6c6363f0.tar.gz external_mesa3d-448156f769ebf271a6a8c03c61588c3e6c6363f0.tar.bz2 |
mesa: add support for 'invariant' keyword for GLSL 1.20
Diffstat (limited to 'src/mesa/shader/slang/library/slang_shader.syn')
-rw-r--r-- | src/mesa/shader/slang/library/slang_shader.syn | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index 883bfe4..3576e32 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -134,6 +134,10 @@ .emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5 .emtcode TYPE_QUALIFIER_FIXEDINPUT 6 +/* invariant qualifier */ +.emtcode TYPE_VARIANT 90 +.emtcode TYPE_INVARIANT 91 + /* type specifier */ .emtcode TYPE_SPECIFIER_VOID 0 .emtcode TYPE_SPECIFIER_BOOL 1 @@ -880,15 +884,18 @@ single_declaration_6 constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN; /* - * <fully_specified_type> ::= <type_specifier> - * | <type_qualifier> <type_specifier> - * | <precision> <type_specifier> - * | <type_qualifier> <precision> <type_specifier> + * <fully_specified_type> ::= <opt_invariant> <opt_qualifer> <opt_precision> <type_specifier> + * + * Example: "invariant varying highp vec3" */ fully_specified_type_space - fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space; + fully_specified_type_optinvariant .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space; fully_specified_type_nospace - fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace; + fully_specified_type_optinvariant .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace; +fully_specified_type_optinvariant + fully_specified_type_invariant .or .true .emit TYPE_VARIANT; +fully_specified_type_invariant + invariant_qualifier .and space; fully_specified_type_optqual fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE; fully_specified_type_qual @@ -899,6 +906,13 @@ fully_specified_type_prec precision .and space; /* + * <invariant_qualifier> ::= "invariant" + */ +invariant_qualifier + "invariant" .emit TYPE_INVARIANT; + + +/* * <type_qualifier> ::= "const" * | "attribute" // Vertex only. * | "varying" @@ -1291,8 +1305,8 @@ translation_unit */ external_declaration precision_stmt .emit DEFAULT_PRECISION .or - invariant_stmt .emit INVARIANT_STMT .or function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or + invariant_stmt .emit INVARIANT_STMT .or declaration .emit EXTERNAL_DECLARATION; |