diff options
author | Zhigang Gong <zhigang.gong@gmail.com> | 2013-08-26 22:45:48 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@linux.intel.com> | 2013-09-06 16:24:57 +0800 |
commit | 4a6106b0b6bc13b76855cfa9b1f4d33248ed97c7 (patch) | |
tree | 806d6c058b4776af8c6cc099d97dae73dd2e8fe8 /src/cl_extensions.c | |
parent | 9a2fd56bc0982499449f2ea84d7e0d5a3d49ad82 (diff) |
CL: Enalbe gl sharing with new egl extension.
The previous implementation is only for 2d/3d texture sharing and
is implemented in a hacky fashinon. We need to replace it with a
clean and complete one. We introduce a new egl extension to export
low level layout information of a buffer object/texture/render buffer
from the mesa dri driver to the cl driver layer. As the extension is
not accpepted by mesa, we have to implement this new extension in
beignet internally.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Tested-by: He Junyan <junyan.he@inbox.com>
Diffstat (limited to 'src/cl_extensions.c')
-rw-r--r-- | src/cl_extensions.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/cl_extensions.c b/src/cl_extensions.c index 335278d6..d07a5257 100644 --- a/src/cl_extensions.c +++ b/src/cl_extensions.c @@ -40,26 +40,12 @@ void check_opt1_extension(cl_extensions_t *extensions) void check_gl_extension(cl_extensions_t *extensions) { -#ifdef HAS_EGL -static struct cl_gl_ext_deps egl_funcs; +#if defined(HAS_EGL) int id; -#if defined(EGL_KHR_image) && defined(EGL_KHR_gl_texture_2D_image) && defined(HAS_GBM) - egl_funcs.eglCreateImageKHR_func = (PFNEGLCREATEIMAGEKHRPROC) eglGetProcAddress("eglCreateImageKHR"); - egl_funcs.eglDestroyImageKHR_func = (PFNEGLDESTROYIMAGEKHRPROC) eglGetProcAddress("eglDestroyImageKHR"); -#else - egl_funcs.eglCreateImageKHR_func = NULL; - egl_funcs.eglDestroyImageKHR_func = NULL; -#endif - - if (egl_funcs.eglCreateImageKHR_func != NULL - && egl_funcs.eglDestroyImageKHR_func != NULL) { /* For now, we only support cl_khr_gl_sharing. */ - for(id = GL_EXT_START_ID; id <= GL_EXT_END_ID; id++) - if (id == EXT_ID(khr_gl_sharing)) { - extensions->extensions[id].base.ext_enabled = 1; - extensions->extensions[id].EXT_STRUCT_NAME(khr_gl_sharing).gl_ext_deps = &egl_funcs; - } - } + for(id = GL_EXT_START_ID; id <= GL_EXT_END_ID; id++) + if (id == EXT_ID(khr_gl_sharing)) + extensions->extensions[id].base.ext_enabled = 1; #endif } |