| 101 | } |
| 102 | |
| 103 | Status CreateCLGLContext(const CLDevice& device, |
| 104 | cl_context_properties egl_context, |
| 105 | cl_context_properties egl_display, CLContext* result) { |
| 106 | if (!device.SupportsExtension("cl_khr_gl_sharing")) { |
| 107 | return UnavailableError("Device doesn't support CL-GL sharing."); |
| 108 | } |
| 109 | cl_context_properties platform = |
| 110 | reinterpret_cast<cl_context_properties>(device.platform()); |
| 111 | cl_context_properties props[] = {CL_GL_CONTEXT_KHR, |
| 112 | egl_context, |
| 113 | CL_EGL_DISPLAY_KHR, |
| 114 | egl_display, |
| 115 | CL_CONTEXT_PLATFORM, |
| 116 | platform, |
| 117 | 0}; |
| 118 | return CreateCLContext(device, props, result); |
| 119 | } |
| 120 | |
| 121 | } // namespace cl |
| 122 | } // namespace gpu |
no test coverage detected