[Mesa-dev] [PATCH 6/6] mesa: Skip glLinkProgram() if it isn't necessary.
Kenneth Graunke
kenneth at whitecape.org
Wed May 14 17:28:17 PDT 2014
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 <kenneth at whitecape.org>
---
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
More information about the mesa-dev
mailing list