mesa: Fix error code generation in glReadPixels()
authorAnuj Phogat <anuj.phogat@gmail.com>
Thu, 13 Mar 2014 01:02:30 +0000 (18:02 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Mon, 21 Apr 2014 18:20:50 +0000 (11:20 -0700)
commitf8ae2a56c6164979223d2268691e354fe56d4bec
tree572fa7db3b50c9186db1d9deca9ee455794cbfb5
parentbd1880dfe8fe1eea12eeb573df34ef328b96013e
mesa: Fix error code generation in glReadPixels()

Section 4.3.1, page 220, of OpenGL 3.3 specification explains
the error conditions for glreadPixels():

   "If the format is DEPTH_STENCIL, then values are taken from
    both the depth buffer and the stencil buffer. If there is
    no depth buffer or if there is no stencil buffer, then the
    error INVALID_OPERATION occurs. If the type parameter is
    not UNSIGNED_INT_24_8 or FLOAT_32_UNSIGNED_INT_24_8_REV,
    then the error INVALID_ENUM occurs."

Fixes failing Khronos CTS test packed_depth_stencil_error.test

V2: Avoid code duplication

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/glformats.c