From: Brian Paul Date: Mon, 4 Aug 2008 22:26:22 +0000 (-0600) Subject: mesa: glsl: varying vars can't be user-defined structs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=793bab2a368be6bbe93ab7f04b887f95c839c36b;p=mesa.git mesa: glsl: varying vars can't be user-defined structs --- 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);