summaryrefslogtreecommitdiffstats
path: root/src/mesa/program
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-07-28 15:42:35 -0700
committerEric Anholt <[email protected]>2010-07-28 15:51:36 -0700
commit859fd56245c1d725cacab17a34793d41ea14e867 (patch)
tree97085dc9b3c5eb1baae763c61ed0146ea17d6000 /src/mesa/program
parent56af4e56e3852363a810174c64650df6f0ae4f53 (diff)
ir_to_mesa: Respect the driver if it rejects a shader.
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index a3019cc650a..3a28c566d4d 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2320,7 +2320,7 @@ get_mesa_program(GLcontext *ctx, struct gl_shader_program *shader_program,
validate_ir_tree(shader->ir);
- prog = ctx->Driver.NewProgram(ctx, target, 1);
+ prog = ctx->Driver.NewProgram(ctx, target, shader_program->Name);
if (!prog)
return NULL;
prog->Parameters = _mesa_new_parameter_list();
@@ -2536,6 +2536,7 @@ _mesa_glsl_link_shader(GLcontext *ctx, struct gl_shader_program *prog)
if (prog->LinkStatus) {
for (i = 0; i < prog->_NumLinkedShaders; i++) {
struct gl_program *linked_prog;
+ bool ok = true;
linked_prog = get_mesa_program(ctx, prog,
prog->_LinkedShaders[i]);
@@ -2547,16 +2548,19 @@ _mesa_glsl_link_shader(GLcontext *ctx, struct gl_shader_program *prog)
case GL_VERTEX_SHADER:
_mesa_reference_vertprog(ctx, &prog->VertexProgram,
(struct gl_vertex_program *)linked_prog);
- ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB,
- linked_prog);
+ ok = ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB,
+ linked_prog);
break;
case GL_FRAGMENT_SHADER:
_mesa_reference_fragprog(ctx, &prog->FragmentProgram,
(struct gl_fragment_program *)linked_prog);
- ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB,
- linked_prog);
+ ok = ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB,
+ linked_prog);
break;
}
+ if (!ok) {
+ prog->LinkStatus = GL_FALSE;
+ }
}
}
}