OSDN Git Service

android: a workaround for GL_INVALID_OPERATION (0x502) error
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 23 Jan 2015 19:53:48 +0000 (03:53 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 16 Jul 2015 13:48:42 +0000 (21:48 +0800)
Inspired by the nice work of Paulo Sergio (pstglia):

"Bypass a check for external target enabled only for images
created with EGL_EXT_image_dma_buf_import - this makes
Android graphical components receive a GL_INVALID_OPERATION (0x502)."

src/mesa/drivers/dri/i965/intel_tex_image.c

index ca69f56..26158c4 100644 (file)
@@ -319,12 +319,15 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
       return;
    }
 
+/* pstglia - I know you are here for a reason, but I want to test if I can live without you temporally...*/
+#ifndef ANDROID
    if (target == GL_TEXTURE_EXTERNAL_OES && !image->dma_buf_imported) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
             "glEGLImageTargetTexture2DOES(external target is enabled only "
                "for images created with EGL_EXT_image_dma_buf_import");
       return;
    }
+#endif
 
    /* Disallow depth/stencil textures: we don't have a way to pass the
     * separate stencil miptree of a GL_DEPTH_STENCIL texture through.