On 9 November 2011 01:10, Yuanhan Liu <span dir="ltr"><<a href="mailto:yuanhan.liu@linux.intel.com">yuanhan.liu@linux.intel.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Don't call set_unfiform_initializers if link failed, or it would trigger<br>
a GL_INVALID_OPERATION error. That's not an expected behavior of<br>
glLinkProgram function.<br>
<br>
Signed-off-by: Yuanhan Liu <<a href="mailto:yuanhan.liu@linux.intel.com">yuanhan.liu@linux.intel.com</a>><br>
---<br>
src/mesa/program/ir_to_mesa.cpp | 4 +++-<br>
1 files changed, 3 insertions(+), 1 deletions(-)<br>
<br>
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp<br>
index 1b8b48e..b00175b 100644<br>
--- a/src/mesa/program/ir_to_mesa.cpp<br>
+++ b/src/mesa/program/ir_to_mesa.cpp<br>
@@ -3513,7 +3513,9 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)<br>
}<br>
}<br>
<br>
- set_uniform_initializers(ctx, prog);<br>
+ if (prog->LinkStatus) {<br>
+ set_uniform_initializers(ctx, prog);<br>
+ }<br>
<br>
if (ctx->Shader.Flags & GLSL_DUMP) {<br>
if (!prog->LinkStatus) {<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.4.4<br>
<br></font></span></blockquote><div><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br></div></div>