glsl: on UBO/SSBOs link error reset the number of active blocks to 0
authorAndres Gomez <agomez@igalia.com>
Wed, 22 Feb 2017 15:03:22 +0000 (17:03 +0200)
committerAndres Gomez <agomez@igalia.com>
Mon, 27 Mar 2017 09:45:59 +0000 (12:45 +0300)
commitbf15b2b515d5f37fc67fea77dea9d2fbc1dc8bf1
tree49ebb7f41141b76eedf5932ee0518fa88e004090
parentc4c02471f485e6e9a8ffdaaa789861dcd5a3b8e9
glsl: on UBO/SSBOs link error reset the number of active blocks to 0

While it's legal to have an active blocks count > 0 on link failure.
Unless we actually assign memory for the blocks array we can end up
segfaulting in calls such as glUniformBlockBinding().

To avoid having to NULL check these api calls we simply reset the
block count to 0 if the array was not created.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Cc: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/linker.cpp