When using MALI-T 820, what should be specified for the fourth argument of eglCreateImageKHR(), EGLClientBuffer buffer?We have confirmed that eglCreateImageKHR() is supported as an OpenGL extension.
Hi aki,
EGLImage can be used to share resources between different APIs (EGL, OpenVX, OpenGL ES, etc). It works like an alias for a resource created from an API (source API) to be used in another API (destination API).
For example, if your platform supports EGL_KHR_image_pixmap extension and you want to create an OpenGL textures (destination API) from an EGL Pixmap (source API) you can do something like this:
//Create an EGLPixmap as pixmapEGLImage eglImage = eglCreateImageKHR(dpy, ctx, EGL_NATIVE_PIXMAP_KHR , (EGLClientBuffer) pixmap, NULL);
Then you can associated the eglImage created to a GLES texture using glEGLImageTargetTexture2DOES.
If you are working with Android and android graphics buffers you can have a look at this: https://gist.github.com/rexguo/6696123
If tell me more about what are you trying to achieve I can give you more precise answers.
Hope it helps,
Daniele
Thanks for the reply Daniele.My goal is to write EGLPixmap as a pixmap that you mentioned.> EGLImage eglImage = eglCreateImageKHR (dpy, ctx, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer) pixmap, NULL);Should I check with the host platform to know the definition of the EGLClientBuffer structure?
You just need to be sure that the platform you are using supports the extension EGL_KHR_image_pixmap. The definition of EGLClientBuffer should already be available to you. The EGLClientBuffer is just an opaque handle to the resource and you don't need to know the internal structure.
You just need to create a native_pixmap and the EGLSurface to be used in eglCreateImageKHR:
egl_native_pixmap_t pixmap;
//Fill pixmap with the proper data
EGLSurface eglPixmap = eglCreatePixmapSurface(dpy, config, pixmap, eglPixmap_attrib_list );
//Create the eglImage from the eglPixmap
EGLImage eglImage = eglCreateImageKHR (dpy, ctx, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer) eglPixmap, eglImage_attrib_list);
Regards,
Thanks for the reply Daniele.I was able to solve the problem.Thank you.
Aki what did you pass in eglPixmap_attrib_list , I have a buffer and I want to create a pixmap from that buffer and then create egl image.
where should I use that buffer while creating pixmap.
Thank you
Sami