mesa: Fix GL_SHADER_BINARY_FORMATS query
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 4 Dec 2012 23:09:39 +0000 (15:09 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Sat, 12 Jan 2013 02:13:52 +0000 (18:13 -0800)
commita0029021681a61d01e5a4603a32cf1bfdfca1d43
treed6683baaab278e4320cc8989356a484f0025c319
parent4f1e037acf1daf2eed76d8a3ff5890619723193f
mesa: Fix GL_SHADER_BINARY_FORMATS query

There were two bugs here.  First, this and several other queries were
not available in a desktop GL context with GL_ARB_ES2_compatibility.
Second, GL_NUM_SHADER_BINARY_FORMATS returns zero, but
GL_SHADER_BINARY_FORMATS writes one element of data to the buffer.  If
NUM is zero, no data should be written.

Fixes piglit test 'arb_get_program_binary-overrun shader'.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/get_hash_params.py