OpenCL.GL.pas 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. //
  2. // The graphics platform GLScene https://github.com/glscene
  3. //
  4. unit OpenCL.GL;
  5. (*
  6. Conversion of OpenCL header file: cl_gl.h to CL_GL.pas,
  7. from http://www.khronos.org/registry/cl/.
  8. *)
  9. ///*****************************************************************************
  10. // * Copyright (c) 2008-2020 The Khronos Group Inc.
  11. // *
  12. // * Permission is hereby granted, free of charge, to any person obtaining a
  13. // * copy of this software and/or associated documentation files (the
  14. // * "Materials"), to deal in the Materials without restriction, including
  15. // * without limitation the rights to use, copy, modify, merge, publish,
  16. // * distribute, sublicense, and/or sell copies of the Materials, and to
  17. // * permit persons to whom the Materials are furnished to do so, subject to
  18. // * the following conditions:
  19. // *
  20. // * The above copyright notice and this permission notice shall be included
  21. // * in all copies or substantial portions of the Materials.
  22. // *
  23. // * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. // * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. // * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  26. // * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  27. // * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  28. // * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  29. // * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
  30. // ****************************************************************************/
  31. interface
  32. uses
  33. OpenCL.Import,
  34. OpenCL.Platform;
  35. type
  36. PGLuint = ^Cardinal;
  37. Tcl_gl_object_type = Tcl_uint;
  38. Pcl_gl_object_type = ^Tcl_gl_object_type;
  39. Tcl_gl_texture_info = Tcl_uint;
  40. Pcl_gl_texture_info = ^Tcl_gl_texture_info;
  41. Tcl_gl_platform_info = Tcl_uint;
  42. Pcl_gl_platform_info = ^Tcl_gl_platform_info;
  43. __GLsync = record end; Pcl_GLsync = ^__GLsync;
  44. //* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken *//
  45. const
  46. CL_GL_OBJECT_BUFFER = $2000;
  47. CL_GL_OBJECT_TEXTURE2D = $2001;
  48. CL_GL_OBJECT_TEXTURE3D = $2002;
  49. CL_GL_OBJECT_RENDERBUFFER = $2003;
  50. CL_GL_OBJECT_TEXTURE2D_ARRAY = $200E;
  51. CL_GL_OBJECT_TEXTURE1D = $200F;
  52. CL_GL_OBJECT_TEXTURE1D_ARRAY = $2010;
  53. CL_GL_OBJECT_TEXTURE_BUFFER = $2011;
  54. //* cl_gl_texture_info *//
  55. CL_GL_TEXTURE_TARGET = $2004;
  56. CL_GL_MIPMAP_LEVEL = $2005;
  57. CL_GL_NUM_SAMPLES = $2012;
  58. function clCreateFromGLBuffer(context: Tcl_context;
  59. flags: Tcl_mem_flags;
  60. bufobj: Cardinal;
  61. errcode_ret: Pcl_int): Tcl_mem; //< CL_API_SUFFIX__VERSION_1_0;
  62. stdcall; external LibOpenCL;
  63. function clCreateFromGLTexture3D(context: Tcl_context;
  64. flags: Tcl_mem_flags;
  65. target: Cardinal;
  66. miplevel: Integer;
  67. texture: Cardinal;
  68. errcode_ret: Pcl_int): Tcl_mem; //< CL_API_SUFFIX__VERSION_1_2;
  69. stdcall; external LibOpenCL;
  70. function clCreateFromGLRenderbuffer(context: Tcl_context;
  71. flags: Tcl_mem_flags;
  72. renderbuffer: Cardinal;
  73. errcode_ret: Pcl_int): Tcl_mem; //< CL_API_SUFFIX__VERSION_1_0;
  74. stdcall; external LibOpenCL;
  75. function clGetGLObjectInfo(memobj: Tcl_mem;
  76. gl_object_type: Pcl_gl_object_type;
  77. gl_object_name: PGLuint): Tcl_int; //< CL_API_SUFFIX__VERSION_1_0;
  78. stdcall; external LibOpenCL;
  79. function clGetGLTextureInfo(memobj: Tcl_mem;
  80. param_name: Tcl_gl_texture_info;
  81. param_value_size: NativeUInt;
  82. param_value: Pointer;
  83. param_value_size_ret: Psize_t): Tcl_int; //< CL_API_SUFFIX__VERSION_1_0;
  84. stdcall; external LibOpenCL;
  85. function clEnqueueAcquireGLObjects(command_queue: Tcl_command_queue;
  86. num_objects: Tcl_uint;
  87. mem_objects: Pcl_mem;
  88. num_events_in_wait_list: Tcl_uint;
  89. event_wait_list: Pcl_event;
  90. event: Pcl_event): Tcl_int; //< CL_API_SUFFIX__VERSION_1_0;
  91. stdcall; external LibOpenCL;
  92. function clEnqueueReleaseGLObjects(command_queue: Tcl_command_queue;
  93. num_objects: Tcl_uint;
  94. mem_objects: Pcl_mem;
  95. num_events_in_wait_list: Tcl_uint;
  96. event_wait_list: Pcl_event;
  97. event: Pcl_event): Tcl_int; //< CL_API_SUFFIX__VERSION_1_0;
  98. stdcall; external LibOpenCL;
  99. //* Deprecated OpenCL 1.1 APIs *//
  100. (* function clCreateFromGLTexture2D(); *)
  101. (* function clCreateFromGLTexture3D(); *)
  102. const
  103. //* cl_khr_gl_sharing extension *//
  104. cl_khr_gl_sharing = 1;
  105. type
  106. Tcl_gl_context_info = Tcl_uint;
  107. Pcl_gl_context_info = ^Tcl_gl_context_info;
  108. const
  109. //* Additional Error Codes *//
  110. CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR = -1000;
  111. //* cl_gl_context_info *//
  112. CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR = $2006;
  113. CL_DEVICES_FOR_GL_CONTEXT_KHR = $2007;
  114. //* Additional cl_context_properties *//
  115. CL_GL_CONTEXT_KHR = $2008;
  116. CL_EGL_DISPLAY_KHR = $2009;
  117. CL_GLX_DISPLAY_KHR = $200A;
  118. CL_WGL_HDC_KHR = $200B;
  119. CL_CGL_SHAREGROUP_KHR = $200C;
  120. function clGetGLContextInfoKHR(properties: Tcl_context_properties;
  121. param_name: Tcl_gl_context_info;
  122. param_value_size: NativeUInt;
  123. param_value: Pointer;
  124. param_value_size_ret: Psize_t): Tcl_int;
  125. stdcall; external LibOpenCL;
  126. (*
  127. function clGetGLContextInfoKHR_fn(properties: Pcl_context_properties;
  128. param_name: Tcl_gl_context_info;
  129. param_value_size: Tsize_t;
  130. param_value: Pointer;
  131. param_value_size_ret: Psize_t): Tcl_int;
  132. stdcall; external LibOpenCL;
  133. *)
  134. //--------------------------------------------------------------------
  135. implementation
  136. //--------------------------------------------------------------------
  137. end.