The call sequence like bellow was causing flickering:
glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex);
glBindTexture(GL_TEXTURE_2D, 0);
glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img);
Eventually zero texture was used on the host side since external
textures are currently handled as GL_TEXTURE_2D.
Change-Id: I9d8480df7dd5f44f49f31e170de6f478c663f8c3
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
texture->binding = NULL;
}
+ /*
+ * FIXME We still need to update the host binding when using external
+ * textures even if that same image is already set. E.g. consider the bellow
+ * scenario:
+ * glBindTexture(GL_TEXTURE_EXTERNAL_OES, tex);
+ * glBindTexture(GL_TEXTURE_2D, 0);
+ * glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, img);
+ * External textures are handled as GL_TEXTURE_2D thus the corresponding
+ * host binding will be zero in this case.
+ */
if (texture->image == image) {
- return;
+ goto bind;
}
yagl_gles_image_acquire(image);
texture->global_name = image->tex_global_name;
texture->image = image;
+bind:
yagl_host_glBindTexture(texture->target == GL_TEXTURE_EXTERNAL_OES ? GL_TEXTURE_2D : texture->target,
texture->global_name);
}