cl_egl.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*******************************************************************************
  2. * Copyright (c) 2008-2010 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. * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  19. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  20. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  21. * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
  22. ******************************************************************************/
  23. #ifndef __OPENCL_CL_EGL_H
  24. #define __OPENCL_CL_EGL_H
  25. #ifdef __APPLE__
  26. #else
  27. #include <CL/cl.h>
  28. #include <EGL/egl.h>
  29. #include <EGL/eglext.h>
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* Command type for events created with clEnqueueAcquireEGLObjectsKHR */
  35. #define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F
  36. #define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D
  37. #define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E
  38. /* Error type for clCreateFromEGLImageKHR */
  39. #define CL_INVALID_EGL_OBJECT_KHR -1093
  40. #define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092
  41. /* CLeglImageKHR is an opaque handle to an EGLImage */
  42. typedef void* CLeglImageKHR;
  43. /* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
  44. typedef void* CLeglDisplayKHR;
  45. /* properties passed to clCreateFromEGLImageKHR */
  46. typedef intptr_t cl_egl_image_properties_khr;
  47. #define cl_khr_egl_image 1
  48. extern CL_API_ENTRY cl_mem CL_API_CALL
  49. clCreateFromEGLImageKHR(cl_context /* context */,
  50. CLeglDisplayKHR /* egldisplay */,
  51. CLeglImageKHR /* eglimage */,
  52. cl_mem_flags /* flags */,
  53. const cl_egl_image_properties_khr * /* properties */,
  54. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  55. typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)(
  56. cl_context context,
  57. CLeglDisplayKHR egldisplay,
  58. CLeglImageKHR eglimage,
  59. cl_mem_flags flags,
  60. const cl_egl_image_properties_khr * properties,
  61. cl_int * errcode_ret);
  62. extern CL_API_ENTRY cl_int CL_API_CALL
  63. clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */,
  64. cl_uint /* num_objects */,
  65. const cl_mem * /* mem_objects */,
  66. cl_uint /* num_events_in_wait_list */,
  67. const cl_event * /* event_wait_list */,
  68. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  69. typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)(
  70. cl_command_queue command_queue,
  71. cl_uint num_objects,
  72. const cl_mem * mem_objects,
  73. cl_uint num_events_in_wait_list,
  74. const cl_event * event_wait_list,
  75. cl_event * event);
  76. extern CL_API_ENTRY cl_int CL_API_CALL
  77. clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */,
  78. cl_uint /* num_objects */,
  79. const cl_mem * /* mem_objects */,
  80. cl_uint /* num_events_in_wait_list */,
  81. const cl_event * /* event_wait_list */,
  82. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  83. typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)(
  84. cl_command_queue command_queue,
  85. cl_uint num_objects,
  86. const cl_mem * mem_objects,
  87. cl_uint num_events_in_wait_list,
  88. const cl_event * event_wait_list,
  89. cl_event * event);
  90. #define cl_khr_egl_event 1
  91. extern CL_API_ENTRY cl_event CL_API_CALL
  92. clCreateEventFromEGLSyncKHR(cl_context /* context */,
  93. EGLSyncKHR /* sync */,
  94. EGLDisplay /* display */,
  95. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  96. typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
  97. cl_context context,
  98. EGLSyncKHR sync,
  99. EGLDisplay display,
  100. cl_int * errcode_ret);
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104. #endif /* __OPENCL_CL_EGL_H */