mesa: Make glGetIntegerv(GL_*_ARRAY_SIZE) return GL_BGRA.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 1 Jun 2014 19:50:17 +0000 (20:50 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 3 Jun 2014 11:20:53 +0000 (12:20 +0100)
commite3e13d6b857b3083e2553457fe30ddfd4eddead4
tree2dcb2309b06e13db74032ec9b6cbd7cfc1cf8e17
parent53468dee0359a4ec3c9edd334656de0ddc47e477
mesa: Make glGetIntegerv(GL_*_ARRAY_SIZE) return GL_BGRA.

Same as b026b6bbfe3f15c8a7296ac107dc3d31f74e401e, but
COLOR_ARRAY_SIZE/SECONDARY_COLOR_ARRAY_SIZE.

Ideally we wouldn't munge the incoming state, so that we wouldn't need
to unmunge it back on glGet*.  But the array size state is copied and
referred in many places, many of which couldn't take an GLenum like
GL_BGRA instead of a plain integer.  So just hack around on glGet*,
to ensure there is no risk of introducing regressions elsewhere.

This bug causes problems to Apitrace, resulting in wrong traces.  See
https://github.com/apitrace/apitrace/issues/261 for details.

Tested with piglit arb_vertex_array_bgra-get, which was created for this
purpose.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
src/mesa/main/get.c
src/mesa/main/get_hash_params.py