[Mesa-dev] [PATCH 1/7] linker: Make linker_error_printf set LinkStatus to false

Ian Romanick idr at freedesktop.org
Mon Aug 1 10:20:17 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

Remove the other places that set LinkStatus to false since they all
immediately follow a call to linker_error_printf.
---
 src/glsl/linker.cpp |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index fe570b6..c260f29 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -172,6 +172,8 @@ linker_error_printf(gl_shader_program *prog, const char *fmt, ...)
    va_start(ap, fmt);
    ralloc_vasprintf_append(&prog->InfoLog, fmt, ap);
    va_end(ap);
+
+   prog->LinkStatus = false;
 }
 
 
@@ -1527,7 +1529,6 @@ assign_varying_locations(struct gl_context *ctx,
 
 	    linker_error_printf(prog, "fragment shader varying %s not written "
 				"by vertex shader\n.", var->name);
-	    prog->LinkStatus = false;
 	 }
 
 	 /* An 'in' variable is only really a shader input if its
@@ -1720,12 +1721,10 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
     * FINISHME: at least 16, so hardcode 16 for now.
     */
    if (!assign_attribute_or_color_locations(prog, MESA_SHADER_VERTEX, 16)) {
-      prog->LinkStatus = false;
       goto done;
    }
 
    if (!assign_attribute_or_color_locations(prog, MESA_SHADER_FRAGMENT, ctx->Const.MaxDrawBuffers)) {
-      prog->LinkStatus = false;
       goto done;
    }
 
@@ -1742,7 +1741,6 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
       if (!assign_varying_locations(ctx, prog,
 				    prog->_LinkedShaders[prev],
 				    prog->_LinkedShaders[i])) {
-	 prog->LinkStatus = false;
 	 goto done;
       }
 
@@ -1775,10 +1773,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
    if (ctx->API == API_OPENGLES2 || prog->Version == 100) {
       if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
 	 linker_error_printf(prog, "program lacks a vertex shader\n");
-	 prog->LinkStatus = false;
       } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) {
 	 linker_error_printf(prog, "program lacks a fragment shader\n");
-	 prog->LinkStatus = false;
       }
    }
 
-- 
1.7.4.4



More information about the mesa-dev mailing list