Beyond issuing a warning, we can actually skip the LinkProgram call if it isn't necessary. Notably, some game engines may set "new" attribute bindings and re-link, when it actually picked the same values, so there was no actual change.
Skips a bunch of unnecessary linking in an upcoming game. Signed-off-by: Kenneth Graunke <[email protected]> --- src/mesa/main/shaderapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 290987a..c56992a 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -945,6 +945,7 @@ link_program(struct gl_context *ctx, GLuint program) if (shProg->LinkStatus && !shProg->NeedsRelink) { _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_LOW, "glLinkProgram(%d) called unnecessarily\n", program); + return; } _mesa_glsl_link_shader(ctx, shProg); -- 1.9.2 _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
