HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cl_egl.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2008-2015 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and/or associated documentation files (the
6  * "Materials"), to deal in the Materials without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Materials, and to
9  * permit persons to whom the Materials are furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Materials.
14  *
15  * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16  * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17  * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18  * https://www.khronos.org/registry/
19  *
20  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27  ******************************************************************************/
28 
29 #ifndef __OPENCL_CL_EGL_H
30 #define __OPENCL_CL_EGL_H
31 
32 #include <CL/cl.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 
39 /* Command type for events created with clEnqueueAcquireEGLObjectsKHR */
40 #define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F
41 #define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D
42 #define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E
43 
44 /* Error type for clCreateFromEGLImageKHR */
45 #define CL_INVALID_EGL_OBJECT_KHR -1093
46 #define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092
47 
48 /* CLeglImageKHR is an opaque handle to an EGLImage */
49 typedef void* CLeglImageKHR;
50 
51 /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
52 typedef void* CLeglDisplayKHR;
53 
54 /* CLeglSyncKHR is an opaque handle to an EGLSync object */
55 typedef void* CLeglSyncKHR;
56 
57 /* properties passed to clCreateFromEGLImageKHR */
58 typedef intptr_t cl_egl_image_properties_khr;
59 
60 
61 #define cl_khr_egl_image 1
62 
65  CLeglDisplayKHR /* egldisplay */,
66  CLeglImageKHR /* eglimage */,
67  cl_mem_flags /* flags */,
68  const cl_egl_image_properties_khr * /* properties */,
69  cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
70 
73  CLeglDisplayKHR egldisplay,
74  CLeglImageKHR eglimage,
76  const cl_egl_image_properties_khr * properties,
77  cl_int * errcode_ret);
78 
79 
80 extern CL_API_ENTRY cl_int CL_API_CALL
82  cl_uint /* num_objects */,
83  const cl_mem * /* mem_objects */,
84  cl_uint /* num_events_in_wait_list */,
85  const cl_event * /* event_wait_list */,
86  cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
87 
89  cl_command_queue command_queue,
90  cl_uint num_objects,
91  const cl_mem * mem_objects,
92  cl_uint num_events_in_wait_list,
93  const cl_event * event_wait_list,
94  cl_event * event);
95 
96 
97 extern CL_API_ENTRY cl_int CL_API_CALL
98 clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */,
99  cl_uint /* num_objects */,
100  const cl_mem * /* mem_objects */,
101  cl_uint /* num_events_in_wait_list */,
102  const cl_event * /* event_wait_list */,
103  cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
104 
106  cl_command_queue command_queue,
107  cl_uint num_objects,
108  const cl_mem * mem_objects,
109  cl_uint num_events_in_wait_list,
110  const cl_event * event_wait_list,
111  cl_event * event);
112 
113 
114 #define cl_khr_egl_event 1
115 
116 extern CL_API_ENTRY cl_event CL_API_CALL
118  CLeglSyncKHR /* sync */,
119  CLeglDisplayKHR /* display */,
120  cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
121 
123  cl_context context,
124  CLeglSyncKHR sync,
125  CLeglDisplayKHR display,
126  cl_int * errcode_ret);
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif /* __OPENCL_CL_EGL_H */
struct _cl_context * cl_context
Definition: cl.h:43
CL_API_ENTRY cl_mem CL_API_CALL clCreateFromEGLImageKHR(cl_context, CLeglDisplayKHR, CLeglImageKHR, cl_mem_flags, const cl_egl_image_properties_khr *, cl_int *) CL_API_SUFFIX__VERSION_1_0
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
Definition: glew.h:2864
void * CLeglImageKHR
Definition: cl_egl.h:49
void * CLeglDisplayKHR
Definition: cl_egl.h:52
#define CL_API_ENTRY
Definition: cl_platform.h:43
CL_API_ENTRY cl_event(CL_API_CALL * clCreateEventFromEGLSyncKHR_fn)(cl_context context, CLeglSyncKHR sync, CLeglDisplayKHR display, cl_int *errcode_ret)
Definition: cl_egl.h:122
CL_API_ENTRY cl_int CL_API_CALL clEnqueueAcquireEGLObjectsKHR(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_API_SUFFIX__VERSION_1_0
CL_API_ENTRY cl_event CL_API_CALL clCreateEventFromEGLSyncKHR(cl_context, CLeglSyncKHR, CLeglDisplayKHR, cl_int *) CL_API_SUFFIX__VERSION_1_0
CL_API_ENTRY cl_mem(CL_API_CALL * clCreateFromEGLImageKHR_fn)(cl_context context, CLeglDisplayKHR egldisplay, CLeglImageKHR eglimage, cl_mem_flags flags, const cl_egl_image_properties_khr *properties, cl_int *errcode_ret)
Definition: cl_egl.h:71
struct _cl_mem * cl_mem
Definition: cl.h:45
cl_event event
Definition: glew.h:3695
struct _cl_event * cl_event
Definition: cl.h:48
struct _cl_command_queue * cl_command_queue
Definition: cl.h:44
CL_API_ENTRY cl_int CL_API_CALL clEnqueueReleaseEGLObjectsKHR(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_API_SUFFIX__VERSION_1_0
void * CLeglSyncKHR
Definition: cl_egl.h:55
#define CL_API_SUFFIX__VERSION_1_0
Definition: cl_platform.h:57
CL_API_ENTRY cl_int(CL_API_CALL * clEnqueueAcquireEGLObjectsKHR_fn)(cl_command_queue command_queue, cl_uint num_objects, const cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Definition: cl_egl.h:88
#define CL_API_CALL
Definition: cl_platform.h:44
#define const
Definition: zconf.h:214
intptr_t cl_egl_image_properties_khr
Definition: cl_egl.h:58
cl_bitfield cl_mem_flags
Definition: cl.h:77
CL_API_ENTRY cl_int(CL_API_CALL * clEnqueueReleaseEGLObjectsKHR_fn)(cl_command_queue command_queue, cl_uint num_objects, const cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Definition: cl_egl.h:105