From: Ian Romanick Date: Wed, 13 Oct 2010 22:13:02 +0000 (-0700) Subject: linker: Reject shaders that have unresolved function calls X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4a45595cf3d6a238bb4d528d30139392618b39df;p=mesa.git linker: Reject shaders that have unresolved function calls This really amounts to just using the return value from link_function_calls. All the work was being done, but the result was being ignored. Fixes piglit test link-unresolved-funciton. NOTE: this is a candidate for the 7.9 branch. --- diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 2cbfd78ba0c..db1b76b3716 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -793,7 +793,7 @@ link_intrastage_shaders(struct gl_context *ctx, return NULL; } - gl_shader *const linked = ctx->Driver.NewShader(NULL, 0, main->Type); + gl_shader *linked = ctx->Driver.NewShader(NULL, 0, main->Type); linked->ir = new(linked) exec_list; clone_ir_list(linked, linked->ir, main->ir); @@ -840,7 +840,11 @@ link_intrastage_shaders(struct gl_context *ctx, assert(idx == num_linking_shaders); - link_function_calls(prog, linked, linking_shaders, num_linking_shaders); + if (!link_function_calls(prog, linked, linking_shaders, + num_linking_shaders)) { + ctx->Driver.DeleteShader(ctx, linked); + linked = NULL; + } free(linking_shaders);