ACTIVE_UNIFORM_MAX_LENGTH should include 3 extra characters for arrays.
authorHaixia Shi <hshi@chromium.org>
Mon, 1 Apr 2013 20:24:55 +0000 (13:24 -0700)
committerStéphane Marchesin <marcheu@chromium.org>
Mon, 1 Apr 2013 20:39:13 +0000 (13:39 -0700)
commitbc0cc2944ff13549df8276b856acc79254c5db07
tree2bf00962f8a04336e8536cffba962871726fc9f4
parente2b40e253b420933ebc504c7fd929168f2afe77d
ACTIVE_UNIFORM_MAX_LENGTH should include 3 extra characters for arrays.

If the active uniform is an array, then the length of the uniform name should
include the three extra characters for the "[0]" suffix, which is required by
the GL 4.2 spec to be appended to the uniform name in glGetActiveUniform().

This avoids the situation where the output buffer does not have enough space
to hold the "[0]" suffix, resulting in an incomplete array specification like
"foobar[0".

NOTE: This is a candidate for the 9.1 branch.

Change-Id: I41e87ba347a7169eec8c575596cc3416adbe0728
Signed-off-by: Haixia Shi <hshi@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/shaderapi.c