ir_to_mesa: don't init unfirom if link failed
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 9 Nov 2011 06:55:53 +0000 (14:55 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 15 Nov 2011 08:25:40 +0000 (16:25 +0800)
Don't call set_unfiform_initializers if link failed, or it would trigger
a GL_INVALID_OPERATION error. That's not an expected behavior of
glLinkProgram function.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/program/ir_to_mesa.cpp

index 0dd44bd7922e8d90dec28dfcb14e438aa99556eb..5cee8377811671685d3ba4605a24c7800a772bc4 100644 (file)
@@ -3458,7 +3458,9 @@ _mesa_glsl_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
       }
    }
 
-   set_uniform_initializers(ctx, prog);
+   if (prog->LinkStatus) {
+      set_uniform_initializers(ctx, prog);
+   }
 
    if (ctx->Shader.Flags & GLSL_DUMP) {
       if (!prog->LinkStatus) {