diff options
author | marha <marha@users.sourceforge.net> | 2011-10-10 08:28:58 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-10-10 08:28:58 +0200 |
commit | baf98f9bb36f956245d83ecd04f90625d6d68d2b (patch) | |
tree | c4af86b7cdb9c57cc539fa0764050865233e3617 /mesalib/src/mesa/program/ir_to_mesa.cpp | |
parent | 7fae5492e3ef8e5fa15f742be4c2a15b9782e89a (diff) | |
parent | afbd3947071a33f59dda122f1ac396442a02c128 (diff) | |
download | vcxsrv-baf98f9bb36f956245d83ecd04f90625d6d68d2b.tar.gz vcxsrv-baf98f9bb36f956245d83ecd04f90625d6d68d2b.tar.bz2 vcxsrv-baf98f9bb36f956245d83ecd04f90625d6d68d2b.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/program/ir_to_mesa.cpp')
-rw-r--r-- | mesalib/src/mesa/program/ir_to_mesa.cpp | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp index 2e1b8fba3..5be44bc51 100644 --- a/mesalib/src/mesa/program/ir_to_mesa.cpp +++ b/mesalib/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_vertprog(ctx, &prog->VertexProgram, - (struct gl_vertex_program *)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); - ok = ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, - linked_prog); - break; - case GL_GEOMETRY_SHADER: - _mesa_reference_geomprog(ctx, &prog->GeometryProgram, - (struct gl_geometry_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; } } @@ -3427,10 +3416,6 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) } } - _mesa_reference_vertprog(ctx, &prog->VertexProgram, NULL); - _mesa_reference_fragprog(ctx, &prog->FragmentProgram, NULL); - _mesa_reference_geomprog(ctx, &prog->GeometryProgram, NULL); - if (prog->LinkStatus) { link_shaders(ctx, prog); } |