Mesa (master): ir_to_mesa: don't init unfirom if link failed

Yuanhan Liu yliu at kemper.freedesktop.org
Tue Nov 15 08:30:49 UTC 2011


Module: Mesa
Branch: master
Commit: 9d4d9d34d82646e4e7781bb25a64174d35680578
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9d4d9d34d82646e4e7781bb25a64174d35680578

Author: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Date:   Wed Nov  9 14:55:53 2011 +0800

ir_to_mesa: don't init unfirom if link failed

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 at linux.intel.com>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>

---

 src/mesa/program/ir_to_mesa.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 0dd44bd..5cee837 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -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) {




More information about the mesa-commit mailing list