diff options
author | Ian Romanick <[email protected]> | 2010-10-13 15:13:02 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-10-13 15:30:19 -0700 |
commit | 4a45595cf3d6a238bb4d528d30139392618b39df (patch) | |
tree | 65ab2c2fe7416522f9da52c0270f5c4cd474c246 /src/glsl/linker.cpp | |
parent | 720bdfbceb5b20bbbb4090cca7a1825ca5f89260 (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.
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r-- | src/glsl/linker.cpp | 8 |
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); |