summaryrefslogtreecommitdiff
path: root/src/mesa/shader
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-08-05 20:00:59 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-08-05 20:57:17 -0600
commitbf3040d4767702f09e042c58f0f5aa942ddb9a16 (patch)
treeff3e4cf69c6067c966184fef0849f5b535aac103 /src/mesa/shader
parentab0d13dd60c707f2c414fa9fe8e489a9e24a8aee (diff)
mesa: glsl: generate error for main(any args)
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/slang/slang_compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 82df9b95d3..5ce0e2e321 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -2025,6 +2025,12 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit,
A.vartable = o.vartable;
A.log = C->L;
+ /* main() takes no parameters */
+ if (mainFunc->param_count > 0) {
+ slang_info_log_error(A.log, "main() takes no arguments");
+ return GL_FALSE;
+ }
+
_slang_codegen_function(&A, mainFunc);
shader->Main = GL_TRUE; /* this shader defines main() */