ocl: fix OpenGL sharing detection (6052)

Apple OpenCL framework hasn't OpenGL sharing extension
This commit is contained in:
Alexander Alekhin
2016-02-04 12:04:04 +03:00
parent 87bbaa2c27
commit c7bdbef504
10 changed files with 45 additions and 2 deletions

View File

@@ -41,6 +41,8 @@
#undef clGetGLTextureInfo
#define clGetGLTextureInfo clGetGLTextureInfo_pfn
#ifdef cl_khr_gl_sharing
// generated by parser_cl.py
extern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLBuffer)(cl_context, cl_mem_flags, cl_GLuint, int*);
extern CL_RUNTIME_EXPORT cl_mem (CL_API_CALL*clCreateFromGLRenderbuffer)(cl_context, cl_mem_flags, cl_GLuint, cl_int*);
@@ -52,3 +54,5 @@ extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clEnqueueReleaseGLObjects)(cl_comma
extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetGLContextInfoKHR)(const cl_context_properties*, cl_gl_context_info, size_t, void*, size_t*);
extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetGLObjectInfo)(cl_mem, cl_gl_object_type*, cl_GLuint*);
extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL*clGetGLTextureInfo)(cl_mem, cl_gl_texture_info, size_t, void*, size_t*);
#endif // cl_khr_gl_sharing

View File

@@ -5,6 +5,8 @@
#error "Invalid usage"
#endif
#ifdef cl_khr_gl_sharing
// generated by parser_cl.py
#undef clCreateFromGLBuffer
#define clCreateFromGLBuffer clCreateFromGLBuffer_fn
@@ -36,3 +38,5 @@ inline cl_int clGetGLObjectInfo(cl_mem p0, cl_gl_object_type* p1, cl_GLuint* p2)
#undef clGetGLTextureInfo
#define clGetGLTextureInfo clGetGLTextureInfo_fn
inline cl_int clGetGLTextureInfo(cl_mem p0, cl_gl_texture_info p1, size_t p2, void* p3, size_t* p4) { return clGetGLTextureInfo_pfn(p0, p1, p2, p3, p4); }
#endif // cl_khr_gl_sharing