diff options
author | Alexis Hetu <sugoi@google.com> | 2018-04-09 11:43:58 -0400 |
---|---|---|
committer | Alexis Hétu <sugoi@google.com> | 2018-04-09 16:46:29 +0000 |
commit | 0f4c4f8df8c74796369dec2473ce0e8edfb66474 (patch) | |
tree | 0559006b36bfae9392097f97d3008db6da73ba26 | |
parent | 1119ce641315de5b76b71df390444f5810319d19 (diff) | |
download | swiftshader-0f4c4f8df8c74796369dec2473ce0e8edfb66474.tar.gz |
WebGL test fix for MacOS
On MacOS, the BGRA format is used for framebuffers. Because of that,
copying from the BGRA format must be allowed in the same places the
RGBA format is allowed.
This fixes the following WebGL test on MacOS:
conformance/textures/misc/copy-tex-image-2d-formats.html
Change-Id: I45c6b81a894dd8d55c4ab5cff0cf9ad1a08c8303
Reviewed-on: https://swiftshader-review.googlesource.com/18348
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
-rw-r--r-- | src/OpenGL/libGLESv2/utilities.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/OpenGL/libGLESv2/utilities.cpp b/src/OpenGL/libGLESv2/utilities.cpp index 76b5b12ae..109cb8eae 100644 --- a/src/OpenGL/libGLESv2/utilities.cpp +++ b/src/OpenGL/libGLESv2/utilities.cpp @@ -571,7 +571,8 @@ namespace es2 { case GL_ALPHA: if(baseColorbufferFormat != GL_ALPHA && - baseColorbufferFormat != GL_RGBA) + baseColorbufferFormat != GL_RGBA && + baseColorbufferFormat != GL_BGRA_EXT) // GL_EXT_texture_format_BGRA8888 / GL_APPLE_texture_format_BGRA8888 { return error(GL_INVALID_OPERATION, false); } @@ -589,7 +590,8 @@ namespace es2 if(baseColorbufferFormat != GL_RED && baseColorbufferFormat != GL_RG && baseColorbufferFormat != GL_RGB && - baseColorbufferFormat != GL_RGBA) + baseColorbufferFormat != GL_RGBA && + baseColorbufferFormat != GL_BGRA_EXT) // GL_EXT_texture_format_BGRA8888 / GL_APPLE_texture_format_BGRA8888 { return error(GL_INVALID_OPERATION, false); } @@ -597,14 +599,16 @@ namespace es2 case GL_RG: if(baseColorbufferFormat != GL_RG && baseColorbufferFormat != GL_RGB && - baseColorbufferFormat != GL_RGBA) + baseColorbufferFormat != GL_RGBA && + baseColorbufferFormat != GL_BGRA_EXT) // GL_EXT_texture_format_BGRA8888 / GL_APPLE_texture_format_BGRA8888 { return error(GL_INVALID_OPERATION, false); } break; case GL_RGB: if(baseColorbufferFormat != GL_RGB && - baseColorbufferFormat != GL_RGBA) + baseColorbufferFormat != GL_RGBA && + baseColorbufferFormat != GL_BGRA_EXT) // GL_EXT_texture_format_BGRA8888 / GL_APPLE_texture_format_BGRA8888 { return error(GL_INVALID_OPERATION, false); } |