cl_egl.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. /* CLeglSyncKHR is an opaque handle to an EGLSync object */
  46. typedef void* CLeglSyncKHR;
  47. /* properties passed to clCreateFromEGLImageKHR */
  48. typedef intptr_t cl_egl_image_properties_khr;
  49. #define cl_khr_egl_image 1
  50. extern CL_API_ENTRY cl_mem CL_API_CALL
  51. clCreateFromEGLImageKHR(cl_context /* context */,
  52. CLeglDisplayKHR /* egldisplay */,
  53. CLeglImageKHR /* eglimage */,
  54. cl_mem_flags /* flags */,
  55. const cl_egl_image_properties_khr * /* properties */,
  56. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  57. typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)(
  58. cl_context context,
  59. CLeglDisplayKHR egldisplay,
  60. CLeglImageKHR eglimage,
  61. cl_mem_flags flags,
  62. const cl_egl_image_properties_khr * properties,
  63. cl_int * errcode_ret);
  64. extern CL_API_ENTRY cl_int CL_API_CALL
  65. clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */,
  66. cl_uint /* num_objects */,
  67. const cl_mem * /* mem_objects */,
  68. cl_uint /* num_events_in_wait_list */,
  69. const cl_event * /* event_wait_list */,
  70. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  71. typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)(
  72. cl_command_queue command_queue,
  73. cl_uint num_objects,
  74. const cl_mem * mem_objects,
  75. cl_uint num_events_in_wait_list,
  76. const cl_event * event_wait_list,
  77. cl_event * event);
  78. extern CL_API_ENTRY cl_int CL_API_CALL
  79. clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */,
  80. cl_uint /* num_objects */,
  81. const cl_mem * /* mem_objects */,
  82. cl_uint /* num_events_in_wait_list */,
  83. const cl_event * /* event_wait_list */,
  84. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  85. typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)(
  86. cl_command_queue command_queue,
  87. cl_uint num_objects,
  88. const cl_mem * mem_objects,
  89. cl_uint num_events_in_wait_list,
  90. const cl_event * event_wait_list,
  91. cl_event * event);
  92. #define cl_khr_egl_event 1
  93. extern CL_API_ENTRY cl_event CL_API_CALL
  94. clCreateEventFromEGLSyncKHR(cl_context /* context */,
  95. CLeglSyncKHR /* sync */,
  96. CLeglDisplayKHR /* display */,
  97. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  98. typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
  99. cl_context context,
  100. CLeglSyncKHR sync,
  101. CLeglDisplayKHR display,
  102. cl_int * errcode_ret);
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif /* __OPENCL_CL_EGL_H */