diff options
author | Chuanbo Weng <chuanbo.weng@intel.com> | 2016-09-07 18:59:05 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-09-12 16:48:52 +0800 |
commit | a892148ee12cbaa021b680c4d770e53fab511366 (patch) | |
tree | c342b5e66f0b3a4761db94cd3dd8b2f022f3c733 /utests/utest_helper.cpp | |
parent | 7fb38b6df350908276ed214d6650074faff43b7a (diff) | |
download | beignet-a892148ee12cbaa021b680c4d770e53fab511366.tar.gz |
Runtime: re-enable cl_khr_gl_sharing with existing egl extension.
In order to query low level layout of GL buffer object/texture/render
buffer, previous implementation introduced an egl extension and
implemented in Beignet side. This way is broken once mesa change its
related internal code. In this patch, we use an new egl extension
(EGL_MESA_image_dma_buf_export) to query related layout infomations
of gl texture. Since this egl extension is already accepted by Khronos,
so it's a stable method. This patch just implement GL texture 2d buffer
sharing, and we will implement other target type if necessary.
v2:
Add CMake build option to enable cl_khr_gl_sharing(default off).
Clean up related CMake code.
Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'utests/utest_helper.cpp')
-rw-r--r-- | utests/utest_helper.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp index 70a69cc1..d12dccf7 100644 --- a/utests/utest_helper.cpp +++ b/utests/utest_helper.cpp @@ -57,7 +57,7 @@ __thread size_t locals[3] = {}; float ULPSIZE_FAST_MATH = 10000.; __attribute__ ((visibility ("internal"))) clGetKernelSubGroupInfoKHR_cb* utestclGetKernelSubGroupInfoKHR = NULL; -#ifdef HAS_EGL +#ifdef HAS_GL_EGL_X11 Display *xDisplay; EGLDisplay eglDisplay; EGLContext eglContext = NULL; @@ -435,7 +435,7 @@ cl_ocl_init(void) cl_int status = CL_SUCCESS; cl_uint platform_n; size_t i; -#ifdef HAS_EGL +#ifdef HAS_GL_EGL_X11 bool hasGLExt = false; #endif cl_context_properties *props = NULL; @@ -464,7 +464,7 @@ cl_ocl_init(void) GET_DEVICE_STR_INFO(version, VERSION); GET_DEVICE_STR_INFO(extensions, EXTENSIONS); GET_DEVICE_STR_INFO(opencl_c_version, OPENCL_C_VERSION); -#ifdef HAS_EGL +#ifdef HAS_GL_EGL_X11 if (std::strstr(extensionsStr.c_str(), "cl_khr_gl_sharing")) { hasGLExt = true; } @@ -476,7 +476,7 @@ cl_ocl_init(void) goto error; } -#ifdef HAS_EGL +#ifdef HAS_GL_EGL_X11 if (hasGLExt) { int i = 0; props = new cl_context_properties[7]; @@ -556,7 +556,7 @@ cl_ocl_destroy(void) { clReleaseCommandQueue(queue); clReleaseContext(ctx); -#ifdef HAS_EGL +#ifdef HAS_GL_EGL_X11 if (eglContext != NULL) { cl_ocl_destroy_egl_window(); eglContext = NULL; |