mesa: glsl: varying vars can't be user-defined structs
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 4 Aug 2008 22:26:22 +0000 (16:26 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 4 Aug 2008 23:14:49 +0000 (17:14 -0600)
src/mesa/shader/slang/slang_codegen.c

index 8414f2ebde028b088267978df86fef4629c5a2eb..b69943022a71f88ecb06158617b8402c7bf297c6 100644 (file)
@@ -3594,7 +3594,7 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
             else {
                slang_info_log_error(A->log,
                                     "invalid datatype for uniform variable %s",
-                                    (char *) var->a_name);
+                                    varName);
             }
             return GL_FALSE;
          }
@@ -3616,6 +3616,13 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
       if (dbg) printf("UNIFORM (sz %d) ", totalSize);
    }
    else if (var->type.qualifier == SLANG_QUAL_VARYING) {
+      if (var->type.specifier.type == SLANG_SPEC_STRUCT) {
+         slang_info_log_error(A->log,
+                              "varying '%s' cannot be a structure type",
+                              varName);
+         return GL_FALSE;
+      }
+
       if (prog) {
          /* user-defined varying */
          GLint varyingLoc = _mesa_add_varying(prog->Varying, varName, size);