From 793bab2a368be6bbe93ab7f04b887f95c839c36b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 4 Aug 2008 16:26:22 -0600 Subject: [PATCH] mesa: glsl: varying vars can't be user-defined structs --- src/mesa/shader/slang/slang_codegen.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 8414f2ebde0..b69943022a7 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -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); -- 2.30.2