summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang
diff options
context:
space:
mode:
authorSam Hocevar <sam@zoy.org>2008-09-25 14:56:41 +0200
committerBrian Paul <brian.paul@tungstengraphics.com>2008-09-25 09:53:09 -0600
commit7be5411ce69f0f6be1f31079b9fbdea4967358a0 (patch)
treeb733e98ee456bd02143bd0ddd9cb98bd28d7bf3c /src/mesa/shader/slang
parent561787e69759ed757edb897c027d2d94beac8d11 (diff)
mesa: prevent the slang code generator from aborting when faced with a sampler variable redeclaration.
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 7006e86958..72a3c0ef9e 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -2439,7 +2439,11 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var)
/*assert(!var->declared);*/
var->declared = GL_TRUE;
- assert(!is_sampler_type(&var->type));
+ if(is_sampler_type(&var->type)) {
+ slang_info_log_error(A->log, "redeclaration of sampler '%s'",
+ (char*) var->a_name);
+ return NULL;
+ }
n = new_node0(IR_VAR_DECL);
if (n) {