aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/library/slang_shader_syn.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-07-16 14:27:50 -0600
committerBrian Paul <[email protected]>2008-07-16 16:11:38 -0600
commitebcdbff6f1f6fa4749e88f9984b0df784a3d9a0c (patch)
treec71ff0cb756159ae43b45d68fa0fee9e3606b619 /src/mesa/shader/slang/library/slang_shader_syn.h
parent7a0b79fe3632ca45def56679868473334ef1e194 (diff)
mesa: implement grammar/parsing for precision/invariant syntax
Plus, fix some issues with pre-defined preprocessor symbols and version checking.
Diffstat (limited to 'src/mesa/shader/slang/library/slang_shader_syn.h')
-rw-r--r--src/mesa/shader/slang/library/slang_shader_syn.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h
index fe37adcac4a..c0fef6e4e3d 100644
--- a/src/mesa/shader/slang/library/slang_shader_syn.h
+++ b/src/mesa/shader/slang/library/slang_shader_syn.h
@@ -6,6 +6,11 @@
".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 DECLARATION_FUNCTION_PROTOTYPE 1\n"
".emtcode DECLARATION_INIT_DECLARATOR_LIST 2\n"
".emtcode FUNCTION_ORDINARY 0\n"
@@ -41,6 +46,7 @@
".emtcode TYPE_QUALIFIER_UNIFORM 4\n"
".emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5\n"
".emtcode TYPE_QUALIFIER_FIXEDINPUT 6\n"
+".emtcode TYPE_QUALIFIER_INVARIANT_VARYING 7\n"
".emtcode TYPE_SPECIFIER_VOID 0\n"
".emtcode TYPE_SPECIFIER_BOOL 1\n"
".emtcode TYPE_SPECIFIER_BVEC2 2\n"
@@ -137,6 +143,8 @@
".errtext LBRACE_EXPECTED \"2003: '{' expected but '$err_token$' found.\"\n"
".errtext LPAREN_EXPECTED \"2004: '(' expected but '$err_token$' found.\"\n"
".errtext RPAREN_EXPECTED \"2005: ')' expected but '$err_token$' found.\"\n"
+".errtext INVALID_PRECISION \"2006: Invalid precision specifier '$err_token$'.\"\n"
+".errtext INVALID_PRECISION_TYPE \"2007: Invalid precision type '$err_token$'.\"\n"
".regbyte parsing_builtin 0\n"
".regbyte shader_type 0\n"
"variable_identifier\n"
@@ -597,8 +605,29 @@
" .loop external_declaration .and optional_space .and\n"
" '\\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n"
"external_declaration\n"
+" precision_stmt .emit DEFAULT_PRECISION .or\n"
+" invariant_stmt .emit INVARIANT_STMT .or\n"
" function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\n"
" declaration .emit EXTERNAL_DECLARATION;\n"
+"precision_stmt\n"
+" \"precision\" .and space .and precision .error INVALID_PRECISION .and space .and prectype .error INVALID_PRECISION_TYPE .and semicolon;\n"
+"precision\n"
+" \"lowp\" .emit PRECISION_LOW .or\n"
+" \"mediump\" .emit PRECISION_MEDIUM .or\n"
+" \"highp\" .emit PRECISION_HIGH;\n"
+"prectype\n"
+" \"int\" .emit TYPE_SPECIFIER_INT .or\n"
+" \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n"
+" \"sampler1D\" .emit TYPE_SPECIFIER_SAMPLER1D .or\n"
+" \"sampler2D\" .emit TYPE_SPECIFIER_SAMPLER2D .or\n"
+" \"sampler3D\" .emit TYPE_SPECIFIER_SAMPLER3D .or\n"
+" \"samplerCube\" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\n"
+" \"sampler1DShadow\" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\n"
+" \"sampler2DShadow\" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\n"
+" \"sampler2DRect\" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or\n"
+" \"sampler2DRectShadow\" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW;\n"
+"invariant_stmt\n"
+" \"invariant\" .and space .and identifier .and semicolon;\n"
"function_definition\n"
" function_prototype .and compound_statement_no_new_scope;\n"
"digit_oct\n"