summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-10-13 15:13:02 -0700
committerIan Romanick <[email protected]>2010-10-13 15:30:19 -0700
commit4a45595cf3d6a238bb4d528d30139392618b39df (patch)
tree65ab2c2fe7416522f9da52c0270f5c4cd474c246
parent720bdfbceb5b20bbbb4090cca7a1825ca5f89260 (diff)
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.
-rw-r--r--src/glsl/linker.cpp8
1 files changed, 6 insertions, 2 deletions
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);