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-29 17:23:37 -0600
commit3d500f00d2a09becccd62abc0472090c4faa53d6 (patch)
tree876f2b889ff9c78752b7e70ad0fc25c36f1bfab3 /src/mesa/shader/slang/slang_link.c
parent56bac7a35cf5763c28164224a45dae46e06aacbb (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 8a66b78ec2e..26959d9d151 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()");
}