Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /**********************************************************************************
  2. * Copyright (c) 2008-2019 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. #ifndef __OPENCL_CL_GL_H
  29. #define __OPENCL_CL_GL_H
  30. #include <CL/cl.h>
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. typedef cl_uint cl_gl_object_type;
  35. typedef cl_uint cl_gl_texture_info;
  36. typedef cl_uint cl_gl_platform_info;
  37. typedef struct __GLsync *cl_GLsync;
  38. /* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */
  39. #define CL_GL_OBJECT_BUFFER 0x2000
  40. #define CL_GL_OBJECT_TEXTURE2D 0x2001
  41. #define CL_GL_OBJECT_TEXTURE3D 0x2002
  42. #define CL_GL_OBJECT_RENDERBUFFER 0x2003
  43. #ifdef CL_VERSION_1_2
  44. #define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E
  45. #define CL_GL_OBJECT_TEXTURE1D 0x200F
  46. #define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010
  47. #define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011
  48. #endif
  49. /* cl_gl_texture_info */
  50. #define CL_GL_TEXTURE_TARGET 0x2004
  51. #define CL_GL_MIPMAP_LEVEL 0x2005
  52. #ifdef CL_VERSION_1_2
  53. #define CL_GL_NUM_SAMPLES 0x2012
  54. #endif
  55. extern CL_API_ENTRY cl_mem CL_API_CALL
  56. clCreateFromGLBuffer(cl_context context,
  57. cl_mem_flags flags,
  58. cl_GLuint bufobj,
  59. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  60. #ifdef CL_VERSION_1_2
  61. extern CL_API_ENTRY cl_mem CL_API_CALL
  62. clCreateFromGLTexture(cl_context context,
  63. cl_mem_flags flags,
  64. cl_GLenum target,
  65. cl_GLint miplevel,
  66. cl_GLuint texture,
  67. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
  68. #endif
  69. extern CL_API_ENTRY cl_mem CL_API_CALL
  70. clCreateFromGLRenderbuffer(cl_context context,
  71. cl_mem_flags flags,
  72. cl_GLuint renderbuffer,
  73. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  74. extern CL_API_ENTRY cl_int CL_API_CALL
  75. clGetGLObjectInfo(cl_mem memobj,
  76. cl_gl_object_type * gl_object_type,
  77. cl_GLuint * gl_object_name) CL_API_SUFFIX__VERSION_1_0;
  78. extern CL_API_ENTRY cl_int CL_API_CALL
  79. clGetGLTextureInfo(cl_mem memobj,
  80. cl_gl_texture_info param_name,
  81. size_t param_value_size,
  82. void * param_value,
  83. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  84. extern CL_API_ENTRY cl_int CL_API_CALL
  85. clEnqueueAcquireGLObjects(cl_command_queue command_queue,
  86. cl_uint num_objects,
  87. const cl_mem * mem_objects,
  88. cl_uint num_events_in_wait_list,
  89. const cl_event * event_wait_list,
  90. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  91. extern CL_API_ENTRY cl_int CL_API_CALL
  92. clEnqueueReleaseGLObjects(cl_command_queue command_queue,
  93. cl_uint num_objects,
  94. const cl_mem * mem_objects,
  95. cl_uint num_events_in_wait_list,
  96. const cl_event * event_wait_list,
  97. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  98. /* Deprecated OpenCL 1.1 APIs */
  99. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
  100. clCreateFromGLTexture2D(cl_context context,
  101. cl_mem_flags flags,
  102. cl_GLenum target,
  103. cl_GLint miplevel,
  104. cl_GLuint texture,
  105. cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  106. extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
  107. clCreateFromGLTexture3D(cl_context context,
  108. cl_mem_flags flags,
  109. cl_GLenum target,
  110. cl_GLint miplevel,
  111. cl_GLuint texture,
  112. cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
  113. /* cl_khr_gl_sharing extension */
  114. #define cl_khr_gl_sharing 1
  115. typedef cl_uint cl_gl_context_info;
  116. /* Additional Error Codes */
  117. #define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
  118. /* cl_gl_context_info */
  119. #define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
  120. #define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
  121. /* Additional cl_context_properties */
  122. #define CL_GL_CONTEXT_KHR 0x2008
  123. #define CL_EGL_DISPLAY_KHR 0x2009
  124. #define CL_GLX_DISPLAY_KHR 0x200A
  125. #define CL_WGL_HDC_KHR 0x200B
  126. #define CL_CGL_SHAREGROUP_KHR 0x200C
  127. extern CL_API_ENTRY cl_int CL_API_CALL
  128. clGetGLContextInfoKHR(const cl_context_properties * properties,
  129. cl_gl_context_info param_name,
  130. size_t param_value_size,
  131. void * param_value,
  132. size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
  133. typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
  134. const cl_context_properties * properties,
  135. cl_gl_context_info param_name,
  136. size_t param_value_size,
  137. void * param_value,
  138. size_t * param_value_size_ret);
  139. #ifdef __cplusplus
  140. }
  141. #endif
  142. #endif /* __OPENCL_CL_GL_H */