summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-07-27 11:08:31 -0700
committerPaul Berry <[email protected]>2013-07-30 10:10:26 -0700
commitb95d237fe6731055dad2ff3eaa59e4d6fc14bfff (patch)
tree4fda4c39f30b71e5d36b6dfde466b412ff115be5 /src/glsl/link_varyings.cpp
parent659ec1c958b59b77b5334d1121722ea0c80dddf8 (diff)
glsl: Use a consistent technique for tracking link success/failure.
This patch changes link_shaders() so that it sets prog->LinkStatus to true when it starts, and then relies on linker_error() to set it to false if a link failure occurs. Previously, link_shaders() would set prog->LinkStatus to true halfway through its execution; as a result, linker functions that executed during the first half of link_shaders() would have to do their own success/failure tracking; if they didn't, then calling linker_error() would add an error message to the log, but not cause the link to fail. Since it wasn't always obvious from looking at a linker function whether it was called before or after link_shaders() set prog->LinkStatus to true, this carried a high risk of bugs. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r--src/glsl/link_varyings.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 51cbdaa0e6e..2c7e4514e15 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -43,7 +43,7 @@
/**
* Validate that outputs from one stage match inputs of another
*/
-bool
+void
cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
gl_shader *producer, gl_shader *consumer)
{
@@ -106,7 +106,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
producer_stage, output->name,
output->type->name,
consumer_stage, input->type->name);
- return false;
+ return;
}
}
@@ -121,7 +121,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
(output->centroid) ? "has" : "lacks",
consumer_stage,
(input->centroid) ? "has" : "lacks");
- return false;
+ return;
}
if (input->invariant != output->invariant) {
@@ -133,7 +133,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
(output->invariant) ? "has" : "lacks",
consumer_stage,
(input->invariant) ? "has" : "lacks");
- return false;
+ return;
}
if (input->interpolation != output->interpolation) {
@@ -147,12 +147,10 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog,
output->interpolation_string(),
consumer_stage,
input->interpolation_string());
- return false;
+ return;
}
}
}
-
- return true;
}