diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-12-11 18:02:19 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-01-06 09:07:29 -0700 |
commit | 9b28d5ecd6e034f27cb550d1592f22b052d5cd5a (patch) | |
tree | 4d679623e0ba11522946698276fbe278809d8284 /src/mesa/shader/slang/library/slang_shader_syn.h | |
parent | 1f8109dd06ddbb14756951b5bc6de62cb212e891 (diff) |
mesa: checkpoint commit of GLSL 1.20 array syntax.
This allows things like float[3] x = float[3](1., 2., 3.);
Parsing and AST construction now. Codegen not working yet.
(cherry picked from commit 2dc3de016cd0306bf5b492ed781e824864788f11)
Diffstat (limited to 'src/mesa/shader/slang/library/slang_shader_syn.h')
-rw-r--r-- | src/mesa/shader/slang/library/slang_shader_syn.h | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index 42ff92b65a..bea14d6d70 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -17,6 +17,8 @@ ".emtcode FUNCTION_ORDINARY 0\n" ".emtcode FUNCTION_CONSTRUCTOR 1\n" ".emtcode FUNCTION_OPERATOR 2\n" +".emtcode FUNCTION_CALL_NONARRAY 0\n" +".emtcode FUNCTION_CALL_ARRAY 1\n" ".emtcode OPERATOR_ADDASSIGN 1\n" ".emtcode OPERATOR_SUBASSIGN 2\n" ".emtcode OPERATOR_MULASSIGN 3\n" @@ -83,8 +85,8 @@ ".emtcode TYPE_SPECIFIER_MAT42 29\n" ".emtcode TYPE_SPECIFIER_MAT34 30\n" ".emtcode TYPE_SPECIFIER_MAT43 31\n" -".emtcode TYPE_ARRAY_SIZE 220\n" -".emtcode TYPE_NO_ARRAY_SIZE 221\n" +".emtcode TYPE_SPECIFIER_NONARRAY 0\n" +".emtcode TYPE_SPECIFIER_ARRAY 1\n" ".emtcode FIELD_NONE 0\n" ".emtcode FIELD_NEXT 1\n" ".emtcode FIELD_ARRAY 2\n" @@ -201,7 +203,12 @@ "function_call_header\n" " function_identifier .and lparen;\n" "function_identifier\n" -" identifier;\n" +" identifier .and function_identifier_opt_array;\n" +"function_identifier_opt_array\n" +" function_identifier_array .emit FUNCTION_CALL_ARRAY .or\n" +" .true .emit FUNCTION_CALL_NONARRAY;\n" +"function_identifier_array\n" +" lbracket .and constant_expression .and rbracket;\n" "unary_expression\n" " postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n" " unary_expression_4 .or unary_expression_5;\n" @@ -434,15 +441,9 @@ "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_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;\n" +" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space;\n" "fully_specified_type_nospace\n" -" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_array;\n" -"type_specifier_array\n" -" type_specifier_array_1 .or type_specifier_array_2;\n" -"type_specifier_array_1\n" -" type_specifier_space .and array_size;\n" -"type_specifier_array_2\n" -" type_specifier_nospace .and opt_array_size;\n" +" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace;\n" "fully_specified_type_optinvariant\n" " fully_specified_type_invariant .or .true .emit TYPE_VARIANT;\n" "fully_specified_type_invariant\n" @@ -459,10 +460,6 @@ " fully_specified_type_prec .or .true .emit PRECISION_DEFAULT;\n" "fully_specified_type_prec\n" " precision .and space;\n" -"opt_array_size\n" -" array_size .or .true .emit TYPE_NO_ARRAY_SIZE;\n" -"array_size\n" -" lbracket .emit TYPE_ARRAY_SIZE .and constant_expression .and rbracket;\n" "invariant_qualifier\n" " \"invariant\" .emit TYPE_INVARIANT;\n" "centroid_qualifier\n" @@ -474,7 +471,7 @@ " \"uniform\" .emit TYPE_QUALIFIER_UNIFORM .or\n" " .if (parsing_builtin != 0) \"__fixed_output\" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or\n" " .if (parsing_builtin != 0) \"__fixed_input\" .emit TYPE_QUALIFIER_FIXEDINPUT;\n" -"type_specifier_space\n" +"type_specifier_nonarray_space\n" " \"void\" .emit TYPE_SPECIFIER_VOID .or\n" " \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n" " \"int\" .emit TYPE_SPECIFIER_INT .or\n" @@ -506,8 +503,18 @@ " \"sampler2DRect\" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or\n" " \"sampler2DRectShadow\" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or\n" " type_name .emit TYPE_SPECIFIER_TYPENAME;\n" -"type_specifier_nospace\n" +"type_specifier_nonarray_nospace\n" " struct_specifier .emit TYPE_SPECIFIER_STRUCT;\n" +"type_specifier_nonarray\n" +" type_specifier_nonarray_nospace .or type_specifier_nonarray_space;\n" +"type_specifier_space\n" +" type_specifier_nonarray_space .and .true .emit TYPE_SPECIFIER_NONARRAY;\n" +"type_specifier_nospace\n" +" type_specifier_nospace_array .or type_specifier_nospace_1;\n" +"type_specifier_nospace_1\n" +" type_specifier_nonarray_nospace .and .true .emit TYPE_SPECIFIER_NONARRAY;\n" +"type_specifier_nospace_array\n" +" type_specifier_nonarray .and lbracket .emit TYPE_SPECIFIER_ARRAY .and constant_expression .and rbracket;\n" "struct_specifier\n" " \"struct\" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and\n" " struct_declaration_list .and rbrace .emit FIELD_NONE;\n" |