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
@@ -139,6 +139,8 @@ struct opencl_gl_fn14
} // anonymous namespace
#ifdef cl_khr_gl_sharing
// generated by parser_cl.py
cl_mem (CL_API_CALL*clCreateFromGLBuffer)(cl_context, cl_mem_flags, cl_GLuint, int*) =
opencl_gl_fn4<OPENCL_GL_FN_clCreateFromGLBuffer, cl_mem, cl_context, cl_mem_flags, cl_GLuint, int*>::switch_fn;
@@ -196,3 +198,5 @@ static const struct DynamicFnEntry* opencl_gl_fn_list[] = {
};
// number of enabled functions: 10
#endif // cl_khr_gl_sharing
@@ -254,6 +254,6 @@ def ProcessTemplate(inputFile, ctx, noteLine='//\n// AUTOGENERATED, DO NOT EDIT\
assert line[-1] == '@'
name = line[1:-1]
assert ctx.has_key(name), name
line = ctx[name]
print line,
line = ctx[name] + ('\n' if len(ctx[name]) > 0 and ctx[name][-1] != '\n' else '')
sys.stdout.write(line)
f.close()
View File
@@ -8,4 +8,8 @@
@CL_REMAP_DYNAMIC@
#ifdef cl_khr_gl_sharing
@CL_FN_DECLARATIONS@
#endif // cl_khr_gl_sharing
@@ -4,8 +4,12 @@ namespace {
@CL_FN_SWITCH@
} // anonymous namespace
#ifdef cl_khr_gl_sharing
@CL_FN_ENTRY_DEFINITIONS@
@CL_FN_ENTRY_LIST@
@CL_NUMBER_OF_ENABLED_FUNCTIONS@
#endif // cl_khr_gl_sharing
@@ -2,4 +2,8 @@
#error "Invalid usage"
#endif
#ifdef cl_khr_gl_sharing
@CL_FN_INLINE_WRAPPERS@
#endif // cl_khr_gl_sharing
@@ -286,6 +286,8 @@ static void* opencl_check_fn(int ID)
#include "opencv2/core/opencl/runtime/opencl_gl.hpp"
#ifdef cl_khr_gl_sharing
static void* opencl_gl_check_fn(int ID);
#include "autogenerated/opencl_gl_impl.hpp"
@@ -306,6 +308,8 @@ static void* opencl_gl_check_fn(int ID)
return func;
}
#endif // cl_khr_gl_sharing
#endif // HAVE_OPENGL
#endif