summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/library
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-11-24 17:18:56 -0700
committerBrian Paul <[email protected]>2008-11-24 17:18:56 -0700
commit8d95e66cf78921cd067c4bcf6a1053a7ec3a2ed4 (patch)
treee0353699e7ce0f65167d0d89a94621a220220d2b /src/mesa/shader/slang/library
parent0fab514ff5e7887767936427b5e02b676abebf3a (diff)
mesa: added support for GLSL 1.20 array.length() method
This is the only method supported in GLSL 1.20 so we take a few short-cuts.
Diffstat (limited to 'src/mesa/shader/slang/library')
-rw-r--r--src/mesa/shader/slang/library/slang_shader.syn20
-rw-r--r--src/mesa/shader/slang/library/slang_shader_syn.h7
2 files changed, 27 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn
index a02a3ac5d92..760dfbcea7e 100644
--- a/src/mesa/shader/slang/library/slang_shader.syn
+++ b/src/mesa/shader/slang/library/slang_shader.syn
@@ -251,6 +251,7 @@
.emtcode OP_POSTINCREMENT 60
.emtcode OP_POSTDECREMENT 61
.emtcode OP_PRECISION 62
+.emtcode OP_METHOD 63
/* parameter qualifier */
.emtcode PARAM_QUALIFIER_IN 0
@@ -342,6 +343,25 @@ integer_expression
* <function_call> ::= <function_call_generic>
*/
function_call
+ function_call_or_method;
+
+/*
+ * <function_call_or_method> ::= <regular_function_call>
+ * | <postfix_expression> "." <function_call_generic>
+ */
+function_call_or_method
+ regular_function_call .or method_call;
+
+/*
+ * <method_call> ::= <identifier> "." <function_call_generic>
+ */
+method_call
+ identifier .emit OP_METHOD .and dot .and function_call_generic .and .true .emit OP_END;
+
+/*
+ * <regular_function_call> ::= <function_call_generic>
+ */
+regular_function_call
function_call_generic .emit OP_CALL .and .true .emit OP_END;
/*
diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h
index f6957177823..42ff92b65a8 100644
--- a/src/mesa/shader/slang/library/slang_shader_syn.h
+++ b/src/mesa/shader/slang/library/slang_shader_syn.h
@@ -138,6 +138,7 @@
".emtcode OP_POSTINCREMENT 60\n"
".emtcode OP_POSTDECREMENT 61\n"
".emtcode OP_PRECISION 62\n"
+".emtcode OP_METHOD 63\n"
".emtcode PARAM_QUALIFIER_IN 0\n"
".emtcode PARAM_QUALIFIER_OUT 1\n"
".emtcode PARAM_QUALIFIER_INOUT 2\n"
@@ -175,6 +176,12 @@
"integer_expression\n"
" expression;\n"
"function_call\n"
+" function_call_or_method;\n"
+"function_call_or_method\n"
+" regular_function_call .or method_call;\n"
+"method_call\n"
+" identifier .emit OP_METHOD .and dot .and function_call_generic .and .true .emit OP_END;\n"
+"regular_function_call\n"
" function_call_generic .emit OP_CALL .and .true .emit OP_END;\n"
"function_call_generic\n"
" function_call_generic_1 .or function_call_generic_2;\n"