mesa: prevent the slang code generator from aborting when faced with a sampler variab...
authorSam Hocevar <sam@zoy.org>
Thu, 25 Sep 2008 12:56:41 +0000 (14:56 +0200)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 25 Sep 2008 15:53:09 +0000 (09:53 -0600)
src/mesa/shader/slang/slang_codegen.c

index 7006e86958ded8fc8f3d1b75c0c957fe3ec18a4f..72a3c0ef9ea368d8a2095b4581a092af12682a8f 100644 (file)
@@ -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) {