cl_gl.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /**********************************************************************************
  2. * Copyright (c) 2008-2009 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. /* $Revision: 10424 $ on $Date: 2010-02-17 14:34:49 -0800 (Wed, 17 Feb 2010) $ */
  24. /*
  25. * cl_gl.h contains Khronos-approved (KHR) OpenCL extensions which have
  26. * OpenGL dependencies. The application is responsible for #including
  27. * OpenGL or OpenGL ES headers before #including cl_gl.h.
  28. */
  29. #ifndef __OPENCL_CL_GL_H
  30. #define __OPENCL_CL_GL_H
  31. #ifdef __APPLE__
  32. #include <OpenCL/cl.h>
  33. #else
  34. #include <CL/cl.h>
  35. #endif
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. typedef cl_uint cl_gl_object_type;
  40. typedef cl_uint cl_gl_texture_info;
  41. typedef cl_uint cl_gl_platform_info;
  42. /* cl_gl_object_type */
  43. #define CL_GL_OBJECT_BUFFER 0x2000
  44. #define CL_GL_OBJECT_TEXTURE2D 0x2001
  45. #define CL_GL_OBJECT_TEXTURE3D 0x2002
  46. #define CL_GL_OBJECT_RENDERBUFFER 0x2003
  47. /* cl_gl_texture_info */
  48. #define CL_GL_TEXTURE_TARGET 0x2004
  49. #define CL_GL_MIPMAP_LEVEL 0x2005
  50. extern CL_API_ENTRY cl_mem CL_API_CALL
  51. clCreateFromGLBuffer(cl_context /* context */,
  52. cl_mem_flags /* flags */,
  53. cl_GLuint /* bufobj */,
  54. int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  55. extern CL_API_ENTRY cl_mem CL_API_CALL
  56. clCreateFromGLTexture2D(cl_context /* context */,
  57. cl_mem_flags /* flags */,
  58. cl_GLenum /* target */,
  59. cl_GLint /* miplevel */,
  60. cl_GLuint /* texture */,
  61. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  62. extern CL_API_ENTRY cl_mem CL_API_CALL
  63. clCreateFromGLTexture3D(cl_context /* context */,
  64. cl_mem_flags /* flags */,
  65. cl_GLenum /* target */,
  66. cl_GLint /* miplevel */,
  67. cl_GLuint /* texture */,
  68. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  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. /* cl_khr_gl_sharing extension */
  99. #define cl_khr_gl_sharing 1
  100. typedef cl_uint cl_gl_context_info;
  101. /* Additional Error Codes */
  102. #define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
  103. /* cl_gl_context_info */
  104. #define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
  105. #define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
  106. /* Additional cl_context_properties */
  107. #define CL_GL_CONTEXT_KHR 0x2008
  108. #define CL_EGL_DISPLAY_KHR 0x2009
  109. #define CL_GLX_DISPLAY_KHR 0x200A
  110. #define CL_WGL_HDC_KHR 0x200B
  111. #define CL_CGL_SHAREGROUP_KHR 0x200C
  112. extern CL_API_ENTRY cl_int CL_API_CALL
  113. clGetGLContextInfoKHR(const cl_context_properties * /* properties */,
  114. cl_gl_context_info /* param_name */,
  115. size_t /* param_value_size */,
  116. void * /* param_value */,
  117. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  118. #ifdef __cplusplus
  119. }
  120. #endif
  121. #endif /* __OPENCL_CL_GL_H */