From: Brian Paul Date: Mon, 10 Nov 2008 17:45:50 +0000 (-0700) Subject: mesa: fix logic error in GLSL linker when looking for main() shaders X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df84f788d21d3d2f61a0c5a35b75586d3099cdd4;p=mesa.git mesa: fix logic error in GLSL linker when looking for main() shaders --- diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 511e7406159..4361efc56e5 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -465,12 +465,17 @@ _slang_link(GLcontext *ctx, fragProg = NULL; for (i = 0; i < shProg->NumShaders; i++) { struct gl_shader *shader = shProg->Shaders[i]; - if (shader->Type == GL_VERTEX_SHADER && shader->Main) - vertProg = vertex_program(shader->Program); - else if (shader->Type == GL_FRAGMENT_SHADER && shader->Main) - fragProg = fragment_program(shader->Program); - else + if (shader->Type == GL_VERTEX_SHADER) { + if (shader->Main) + vertProg = vertex_program(shader->Program); + } + else if (shader->Type == GL_FRAGMENT_SHADER) { + if (shader->Main) + fragProg = fragment_program(shader->Program); + } + else { _mesa_problem(ctx, "unexpected shader target in slang_link()"); + } } #if FEATURE_es2_glsl