1
0

cl_gl.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. #ifndef __OPENCL_CL_GL_H
  24. #define __OPENCL_CL_GL_H
  25. #ifdef __APPLE__
  26. #include <OpenCL/cl_platform.h>
  27. #else
  28. #include <MiniCL/cl_platform.h>
  29. #endif
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. // NOTE: Make sure that appropriate GL header file is included separately
  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. // cl_gl_object_type
  38. #define CL_GL_OBJECT_BUFFER 0x2000
  39. #define CL_GL_OBJECT_TEXTURE2D 0x2001
  40. #define CL_GL_OBJECT_TEXTURE3D 0x2002
  41. #define CL_GL_OBJECT_RENDERBUFFER 0x2003
  42. // cl_gl_texture_info
  43. #define CL_GL_TEXTURE_TARGET 0x2004
  44. #define CL_GL_MIPMAP_LEVEL 0x2005
  45. extern CL_API_ENTRY cl_mem CL_API_CALL
  46. clCreateFromGLBuffer(cl_context /* context */,
  47. cl_mem_flags /* flags */,
  48. GLuint /* bufobj */,
  49. int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  50. extern CL_API_ENTRY cl_mem CL_API_CALL
  51. clCreateFromGLTexture2D(cl_context /* context */,
  52. cl_mem_flags /* flags */,
  53. GLenum /* target */,
  54. GLint /* miplevel */,
  55. GLuint /* texture */,
  56. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  57. extern CL_API_ENTRY cl_mem CL_API_CALL
  58. clCreateFromGLTexture3D(cl_context /* context */,
  59. cl_mem_flags /* flags */,
  60. GLenum /* target */,
  61. GLint /* miplevel */,
  62. GLuint /* texture */,
  63. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  64. extern CL_API_ENTRY cl_mem CL_API_CALL
  65. clCreateFromGLRenderbuffer(cl_context /* context */,
  66. cl_mem_flags /* flags */,
  67. GLuint /* renderbuffer */,
  68. cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
  69. extern CL_API_ENTRY cl_int CL_API_CALL
  70. clGetGLObjectInfo(cl_mem /* memobj */,
  71. cl_gl_object_type * /* gl_object_type */,
  72. GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
  73. extern CL_API_ENTRY cl_int CL_API_CALL
  74. clGetGLTextureInfo(cl_mem /* memobj */,
  75. cl_gl_texture_info /* param_name */,
  76. size_t /* param_value_size */,
  77. void * /* param_value */,
  78. size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
  79. extern CL_API_ENTRY cl_int CL_API_CALL
  80. clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */,
  81. cl_uint /* num_objects */,
  82. const cl_mem * /* mem_objects */,
  83. cl_uint /* num_events_in_wait_list */,
  84. const cl_event * /* event_wait_list */,
  85. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  86. extern CL_API_ENTRY cl_int CL_API_CALL
  87. clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,
  88. cl_uint /* num_objects */,
  89. const cl_mem * /* mem_objects */,
  90. cl_uint /* num_events_in_wait_list */,
  91. const cl_event * /* event_wait_list */,
  92. cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96. #endif // __OPENCL_CL_GL_H