OSDN Git Service

mesa: Correctly handle GL_BGRA_EXT in ES3 format_and_type checks
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 7 Oct 2015 22:52:09 +0000 (15:52 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 8 Oct 2015 03:32:53 +0000 (20:32 -0700)
commit6ad9ebb073fc4ed245ef8e9db4479a52e818cb92
tree1fbb5dfa28d70676f3274cd632be938dd2af8cd0
parentbbf728f11b45121bf2d03b61bc0ffc69e0ff0836
mesa: Correctly handle GL_BGRA_EXT in ES3 format_and_type checks

The EXT_texture_format_BGRA8888 extension (which mesa supports
unconditionally) adds a new format and internal format called GL_BGRA_EXT.
Previously, this was not really handled at all in
_mesa_ex3_error_check_format_and_type.  When the checks were tightened in
commit f15a7f3c, we accidentally tightened things too far and GL_BGRA_EXT
would always cause an error to be thrown.

There were two primary issues here.  First, is that
_mesa_es3_effective_internal_format_for_format_and_type didn't handle the
GL_BGRA_EXT format.  Second is that it blindly uses _mesa_base_tex_format
which returns GL_RGBA for GL_BGRA_EXT.  This commit fixes both of these
issues as well as adds explicit checks that GL_BGRA_EXT is only ever used
with GL_BGRA_EXT and GL_UNSIGNED_BYTE.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92265
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
src/mesa/main/glformats.c