I want to use eglimage as texture my linux platform using Mali400.
But the result image is not correct.
-------------------------------------------------------------my source-------------------------------------------------------------------------
glGenTextures(1, texID);
glActiveTexture(GL_TEXTURE0);glBindTexture(GL_TEXTURE_2D, texID[0]);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
#if 0 //===> It's OK ----------------glTexImage2d case OK---------------------
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB, img_width, img_height,0,GL_RGB,GL_UNSIGNED_BYTE,imgBuf)
#else //===> it's not OK ----------------eglimage case Fail---------------------
//set teximage
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB, img_width, img_height,0,GL_RGB,GL_UNSIGNED_BYTE,NULL);
//create
eglimage = eglCreateImageKHR( pStatics->sEGLInfo.sEGLDisplay, pStatics->sEGLInfo.sEGLContext,
EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer) texID[0], NULL);
//update eglimage data from texture data
EGLint attribs_rgb[] = { MALI_EGL_IMAGE_PLANE, MALI_EGL_IMAGE_PLANE_RGB, MALI_EGL_IMAGE_MIPLEVEL, 0, MALI_EGL_IMAGE_ACCESS_MODE, MALI_EGL_IMAGE_ACCESS_READ_WRITE, EGL_NONE };
mali_egl_image *img = mali_egl_image_lock_ptr( eglimage );void *rgb = mali_egl_image_map_buffer( img, attribs_rgb );MEMCPY( rgb, pdata, width*height*3);mali_egl_image_unmap_buffer( img, attribs_rgb );
//connect eglimage to texture
glEGLImageTargetTexture2DOES( GL_TEXTURE_2D, (GLeglImageOES)eglImage);
//destroy
eglDestroyImageKHR(pStatics->sEGLInfo.sEGLDisplay, eglImage);
#endif
----------------------------------------------------------------------------------------------------------------------------------------
I checked there are no egl_error, gl_error, egl_image_error through eglGetError(), glGetError(), mali_egl_image_get_error().
I don't know how to update eglImage exactly.
Can I get some information to solve this problem?
Hi Jenner,
Can you please show some sample code on how you implemented the EGLPixmap + EGLImage + shared memory solution? I'm trying to do the same thing where I create the image in one process and render it in another process and i need some help.
Thanks
Ony