diff options
author | Michal Krol <michal@tungstengraphics.com> | 2008-08-07 16:49:54 +0200 |
---|---|---|
committer | Michal Krol <michal@tungstengraphics.com> | 2008-08-07 16:49:54 +0200 |
commit | 9a20cecc5cf41c5eda6cedd5f30416bc1b49ac91 (patch) | |
tree | 6b370e5ac0927c1b92fbb9752402a7750e0be9b3 /src/mesa/shader/slang/library | |
parent | c5c7130385b1b0d35b52a6df68d9558a92fabd86 (diff) |
mesa: Extend GLSL syntax to accept type precision in full type specifiers.
Diffstat (limited to 'src/mesa/shader/slang/library')
-rw-r--r-- | src/mesa/shader/slang/library/slang_shader.syn | 25 | ||||
-rw-r--r-- | src/mesa/shader/slang/library/slang_shader_syn.h | 23 |
2 files changed, 30 insertions, 18 deletions
diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index 4505758520..06bd8ac883 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -49,7 +49,7 @@ .syntax translation_unit; /* revision number - increment after each change affecting emitted output */ -.emtcode REVISION 3 +.emtcode REVISION 4 /* external declaration (or precision or invariant stmt) */ .emtcode EXTERNAL_NULL 0 @@ -59,9 +59,10 @@ .emtcode INVARIANT_STMT 4 /* precision */ -.emtcode PRECISION_LOW 0 -.emtcode PRECISION_MEDIUM 1 -.emtcode PRECISION_HIGH 2 +.emtcode PRECISION_DEFAULT 0 +.emtcode PRECISION_LOW 1 +.emtcode PRECISION_MEDIUM 2 +.emtcode PRECISION_HIGH 3 /* declaration */ .emtcode DECLARATION_FUNCTION_PROTOTYPE 1 @@ -855,15 +856,21 @@ single_declaration_6 /* <fully_specified_type> ::= <type_specifier> | <type_qualifier> <type_specifier> + | <precision> <type_specifier> + | <type_qualifier> <precision> <type_specifier> */ fully_specified_type_space - fully_specified_type_1 .and type_specifier_space; + fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space; fully_specified_type_nospace - fully_specified_type_1 .and type_specifier_nospace; -fully_specified_type_1 - fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE; -fully_specified_type_2 + fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace; +fully_specified_type_optqual + fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE; +fully_specified_type_qual type_qualifier .and space; +fully_specified_type_optprec + fully_specified_type_prec .or .true .emit PRECISION_DEFAULT; +fully_specified_type_prec + precision .and space; /* <type_qualifier> ::= "const" diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index 0c4c14f9d1..1b258fcdc1 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -2,15 +2,16 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ ".syntax translation_unit;\n" -".emtcode REVISION 3\n" +".emtcode REVISION 4\n" ".emtcode EXTERNAL_NULL 0\n" ".emtcode EXTERNAL_FUNCTION_DEFINITION 1\n" ".emtcode EXTERNAL_DECLARATION 2\n" ".emtcode DEFAULT_PRECISION 3\n" ".emtcode INVARIANT_STMT 4\n" -".emtcode PRECISION_LOW 0\n" -".emtcode PRECISION_MEDIUM 1\n" -".emtcode PRECISION_HIGH 2\n" +".emtcode PRECISION_DEFAULT 0\n" +".emtcode PRECISION_LOW 1\n" +".emtcode PRECISION_MEDIUM 2\n" +".emtcode PRECISION_HIGH 3\n" ".emtcode DECLARATION_FUNCTION_PROTOTYPE 1\n" ".emtcode DECLARATION_INIT_DECLARATOR_LIST 2\n" ".emtcode FUNCTION_ORDINARY 0\n" @@ -413,13 +414,17 @@ "single_declaration_6\n" " constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n" "fully_specified_type_space\n" -" fully_specified_type_1 .and type_specifier_space;\n" +" fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space;\n" "fully_specified_type_nospace\n" -" fully_specified_type_1 .and type_specifier_nospace;\n" -"fully_specified_type_1\n" -" fully_specified_type_2 .or .true .emit TYPE_QUALIFIER_NONE;\n" -"fully_specified_type_2\n" +" fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace;\n" +"fully_specified_type_optqual\n" +" fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE;\n" +"fully_specified_type_qual\n" " type_qualifier .and space;\n" +"fully_specified_type_optprec\n" +" fully_specified_type_prec .or .true .emit PRECISION_DEFAULT;\n" +"fully_specified_type_prec\n" +" precision .and space;\n" "type_qualifier\n" " \"const\" .emit TYPE_QUALIFIER_CONST .or\n" " .if (shader_type == 2) \"attribute\" .emit TYPE_QUALIFIER_ATTRIBUTE .or\n" |