From 7be5411ce69f0f6be1f31079b9fbdea4967358a0 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 25 Sep 2008 14:56:41 +0200 Subject: [PATCH] mesa: prevent the slang code generator from aborting when faced with a sampler variable redeclaration. --- src/mesa/shader/slang/slang_codegen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 7006e86958d..72a3c0ef9ea 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) { -- 2.30.2