Commit bc62c3b8 by Nicolas Capens Committed by Nicolas Capens

Re-implement GL_APPLE_texture_format_BGRA8888.

GL_APPLE_texture_format_BGRA8888 specifies that when using the BGRA_EXT format, it "must have an RGBA internal format". Note that GL_EXT_texture_format_BGRA8888 also allows BGRA_EXT as internalformat. Change-Id: I27e032054240efe96c32e27ebbdfb3c28213b1d8 Reviewed-on: https://swiftshader-review.googlesource.com/16248Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent a5a7566d
......@@ -4428,7 +4428,7 @@ const GLubyte *Context::getExtensions(GLuint index, GLuint *numExt) const
"GL_ANGLE_instanced_arrays",
"GL_ANGLE_texture_compression_dxt3",
"GL_ANGLE_texture_compression_dxt5",
//"GL_APPLE_texture_format_BGRA8888",
"GL_APPLE_texture_format_BGRA8888",
"GL_CHROMIUM_texture_filtering_hint",
"GL_NV_fence",
"GL_NV_framebuffer_blit",
......
......@@ -4953,6 +4953,14 @@ void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width,
if(context)
{
// Core OpenGL ES 2.0 requires format and internalformat to be equal (checked below),
// but GL_APPLE_texture_format_BGRA8888 allows (only) GL_BGRA_EXT / GL_RGBA, while
// GL_EXT_texture_format_BGRA8888 also allows GL_BGRA_EXT / GL_BGRA_EXT.
if(format == GL_BGRA_EXT && internalformat == GL_RGBA)
{
internalformat = GL_BGRA_EXT;
}
GLint clientVersion = context->getClientVersion();
if(clientVersion < 3)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment