summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_link.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-07-24 14:56:54 -0600
committerBrian Paul <[email protected]>2008-07-24 15:11:38 -0600
commit90a3af7d9d0849afcee0d35ed0621fe24e1008a9 (patch)
tree309a8fe2f661afc1e878bc44ac347d754443d010 /src/mesa/shader/slang/slang_link.c
parent4ec4ea14a587300041799c5269295ba7e160ab65 (diff)
mesa: glsl: only try to link shaders defining main()
Diffstat (limited to 'src/mesa/shader/slang/slang_link.c')
-rw-r--r--src/mesa/shader/slang/slang_link.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index e9b9bbc43f1..1de561930a4 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -401,15 +401,16 @@ _slang_link(GLcontext *ctx,
shProg->Varying = _mesa_new_parameter_list();
/**
- * Find attached vertex shader, fragment shader
+ * Find attached vertex, fragment shaders defining main()
*/
vertProg = NULL;
fragProg = NULL;
for (i = 0; i < shProg->NumShaders; i++) {
- if (shProg->Shaders[i]->Type == GL_VERTEX_SHADER)
- vertProg = vertex_program(shProg->Shaders[i]->Programs[0]);
- else if (shProg->Shaders[i]->Type == GL_FRAGMENT_SHADER)
- fragProg = fragment_program(shProg->Shaders[i]->Programs[0]);
+ 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
_mesa_problem(ctx, "unexpected shader target in slang_link()");
}