glsl: Use a consistent technique for tracking link success/failure.
authorPaul Berry <stereotype441@gmail.com>
Sat, 27 Jul 2013 18:08:31 +0000 (11:08 -0700)
committerPaul Berry <stereotype441@gmail.com>
Tue, 30 Jul 2013 17:10:26 +0000 (10:10 -0700)
commitb95d237fe6731055dad2ff3eaa59e4d6fc14bfff
tree4fda4c39f30b71e5d36b6dfde466b412ff115be5
parent659ec1c958b59b77b5334d1121722ea0c80dddf8
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 <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/link_interface_blocks.cpp
src/glsl/link_varyings.cpp
src/glsl/link_varyings.h
src/glsl/linker.cpp
src/glsl/linker.h