aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/program/ir_to_mesa.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-08-20 16:07:10 -0700
committerIan Romanick <[email protected]>2011-10-07 16:39:51 -0700
commite2bdef53807d0f23c2a1ff326ea8190cb57aa90a (patch)
tree23931941d3a090a4e0100fd939ceb5034a85b303 /src/mesa/program/ir_to_mesa.cpp
parent77d67a44cc9788072090e3f1000cfe1cec0a6807 (diff)
mesa: Simplify calling Driver.ProgramStringNotify after previous refactors
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/program/ir_to_mesa.cpp')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index b9b7b1adbe9..5be44bc514d 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -3288,31 +3288,20 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
linked_prog = get_mesa_program(ctx, prog, prog->_LinkedShaders[i]);
if (linked_prog) {
- bool ok = true;
+ static const GLenum targets[] = {
+ GL_VERTEX_PROGRAM_ARB,
+ GL_FRAGMENT_PROGRAM_ARB,
+ GL_GEOMETRY_PROGRAM_NV
+ };
- switch (prog->_LinkedShaders[i]->Type) {
- case GL_VERTEX_SHADER:
+ if (i == MESA_SHADER_VERTEX) {
((struct gl_vertex_program *)linked_prog)->UsesClipDistance
= prog->Vert.UsesClipDistance;
- _mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
- linked_prog);
- ok = ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB,
- linked_prog);
- break;
- case GL_FRAGMENT_SHADER:
- _mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
- linked_prog);
- ok = ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB,
- linked_prog);
- break;
- case GL_GEOMETRY_SHADER:
- _mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
- linked_prog);
- ok = ctx->Driver.ProgramStringNotify(ctx, GL_GEOMETRY_PROGRAM_NV,
- linked_prog);
- break;
- }
- if (!ok) {
+ }
+
+ _mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
+ linked_prog);
+ if (!ctx->Driver.ProgramStringNotify(ctx, targets[i], linked_prog)) {
return GL_FALSE;
}
}