YaGL: Fix for weston incorrect glTexSubImage2D call 52/16652/1
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Thu, 20 Feb 2014 11:00:26 +0000 (15:00 +0400)
committerStanislav Vorobiov <s.vorobiov@samsung.com>
Thu, 20 Feb 2014 11:00:26 +0000 (15:00 +0400)
weston can call glTexSubImage2D with
format = GL_RGB and type = GL_UNSIGNED_SHORT_5_6_5
while texture's internal format is GL_BGRA. Such
combination is not allowed in OpenGL ES, but we allow
it

Change-Id: Ifce29ec49108d26801ea3c56307a13db71b7f42f

GLES_common/yagl_gles_context.c

index 208ae75ce4048a06b2ee56dbc8004cbf0ba085b2..d2c8c35cfa2cd81abb090c7a0bb9c100ec9107d4 100644 (file)
@@ -398,7 +398,7 @@ struct yagl_pixel_format
 
     YAGL_LOG_FUNC_SET(yagl_gles_context_validate_teximage_format);
 
-    if (format == internalformat) {
+    if ((format == internalformat) || (internalformat == GL_BGRA)) {
         switch (format) {
         case GL_RGB:
             switch (type) {