diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-11-24 15:28:21 -0700 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-11-24 15:28:21 -0700 |
commit | 0fab514ff5e7887767936427b5e02b676abebf3a (patch) | |
tree | 38a1fddc8a2958e55c996d4b12a06beccdc9e10a /src/mesa/shader/slang/library/slang_shader.syn | |
parent | b730d0d3e9b202b17a0815cb820fc9905f35cb98 (diff) |
mesa: support for GLSL 1.20 array types
This allows syntax like "float[8] foo, bar;"
Diffstat (limited to 'src/mesa/shader/slang/library/slang_shader.syn')
-rw-r--r-- | src/mesa/shader/slang/library/slang_shader.syn | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index 47245e0d87..a02a3ac5d9 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -178,6 +178,9 @@ .emtcode TYPE_SPECIFIER_MAT34 30 .emtcode TYPE_SPECIFIER_MAT43 31 +/* optional array size. Ex: "float[6] myarray;" */ +.emtcode TYPE_ARRAY_SIZE 220 +.emtcode TYPE_NO_ARRAY_SIZE 221 /* structure field */ .emtcode FIELD_NONE 0 @@ -885,14 +888,22 @@ single_declaration_6 constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN; /* - * <fully_specified_type> ::= <opt_invariant> <opt_centroid> <opt_qualifer> <opt_precision> <type_specifier> + * <fully_specified_type> ::= <opt_invariant> <opt_centroid> <opt_qualifer> <opt_precision> <type_specifier> <opt_array_size> * - * Example: "invariant varying highp vec3" + * Example: "invariant varying highp vec3 [4]" + * + * Note that the *_space version doesn't parse the array size, make sure it is being invoked after the *_nospace version. */ fully_specified_type_space - fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space; + fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space .and .true .emit TYPE_NO_ARRAY_SIZE; fully_specified_type_nospace - fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace; + fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_array; +type_specifier_array + type_specifier_array_1 .or type_specifier_array_2; +type_specifier_array_1 + type_specifier_space .and array_size; +type_specifier_array_2 + type_specifier_nospace .and opt_array_size; fully_specified_type_optinvariant fully_specified_type_invariant .or .true .emit TYPE_VARIANT; fully_specified_type_invariant @@ -909,6 +920,11 @@ fully_specified_type_optprec fully_specified_type_prec .or .true .emit PRECISION_DEFAULT; fully_specified_type_prec precision .and space; +opt_array_size + array_size .or .true .emit TYPE_NO_ARRAY_SIZE; +array_size + lbracket .emit TYPE_ARRAY_SIZE .and constant_expression .and rbracket; + /* * <invariant_qualifier> ::= "invariant" |