CL_D3D11.pas 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. (************************************************)
  24. (* *)
  25. (* OpenCL1.2 and Delphi and Windows *)
  26. (* *)
  27. (* created by : Maksym Tymkovych *)
  28. (* (niello) *)
  29. (* *)
  30. (* headers versions: 0.07 *)
  31. (* file name : CL_d3d11.pas *)
  32. (* last modify : 10.12.11 *)
  33. (* license : BSD *)
  34. (* *)
  35. (* Site : www.niello.org.ua *)
  36. (* e-mail : [email protected] *)
  37. (* ICQ : 446-769-253 *)
  38. (* *)
  39. (* updated by : Alexander Kiselev *)
  40. (* (Igroman) *)
  41. (* Site : http://Igroman14.livejournal.com *)
  42. (* e-mail : [email protected] *)
  43. (* ICQ : 207-381-695 *)
  44. (* (c) 2010 *)
  45. (* *)
  46. (***********Copyright (c) niello 2008-2011*******)
  47. unit CL_D3D11;
  48. interface
  49. {$INCLUDE OpenCL.inc}
  50. uses
  51. CL_Platform,
  52. CL;
  53. (******************************************************************************
  54. * cl_khr_d3d11_sharing *)
  55. const
  56. cl_khr_d3d11_sharing = 1;
  57. type
  58. TCL_d3d11_device_source_khr = TCL_uint;
  59. PCL_d3d11_device_source_khr = ^TCL_d3d11_device_source_khr;
  60. TCL_d3d11_device_set_khr = TCL_uint;
  61. PCL_d3d11_device_set_khr = ^TCL_d3d11_device_set_khr;
  62. (******************************************************************************)
  63. const
  64. // Error Codes
  65. CL_INVALID_D3D11_DEVICE_KHR = -1006;
  66. CL_INVALID_D3D11_RESOURCE_KHR = -1007;
  67. CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR = -1008;
  68. CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR = -1009;
  69. // cl_d3d11_device_source
  70. CL_D3D11_DEVICE_KHR = $4019;
  71. CL_D3D11_DXGI_ADAPTER_KHR = $401A;
  72. // cl_d3d11_device_set
  73. CL_PREFERRED_DEVICES_FOR_D3D11_KHR = $401B;
  74. CL_ALL_DEVICES_FOR_D3D11_KHR = $401C;
  75. // cl_context_info
  76. CL_CONTEXT_D3D11_DEVICE_KHR = $401D;
  77. CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR = $402D;
  78. // cl_mem_info
  79. CL_MEM_D3D11_RESOURCE_KHR = $401E;
  80. // cl_image_info
  81. CL_IMAGE_D3D11_SUBRESOURCE_KHR = $401F;
  82. // cl_command_type
  83. CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR = $4020;
  84. CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR = $4021;
  85. (******************************************************************************)
  86. {$IFDEF CL_VERSION_1_0}
  87. type
  88. TclGetDeviceIDsFromD3D11KHR_fn = function (
  89. cl_platform_id platform,
  90. cl_d3d11_device_source_khr d3d_device_source,
  91. void * d3d_object,
  92. cl_d3d11_device_set_khr d3d_device_set,
  93. cl_uint num_entries,
  94. cl_device_id * devices,
  95. cl_uint * num_devices
  96. ): TCL_int;
  97. {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF};
  98. TclCreateFromD3D11BufferKHR_fn = function (
  99. cl_context context,
  100. cl_mem_flags flags,
  101. ID3D11Buffer * resource,
  102. cl_int * errcode_ret
  103. ): PCL_mem;
  104. {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF};
  105. TclCreateFromD3D11Texture2DKHR_fn = function (
  106. cl_context context,
  107. cl_mem_flags flags,
  108. ID3D11Texture2D * resource,
  109. UINT subresource,
  110. cl_int * errcode_ret
  111. ): PCL_mem;
  112. {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF};
  113. TclCreateFromD3D11Texture3DKHR_fn = function (
  114. cl_context context,
  115. cl_mem_flags flags,
  116. ID3D11Texture3D * resource,
  117. UINT subresource,
  118. cl_int * errcode_ret
  119. ): PCL_mem;
  120. {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF};
  121. TclEnqueueAcquireD3D11ObjectsKHR_fn = function (
  122. cl_command_queue command_queue,
  123. cl_uint num_objects,
  124. const cl_mem * mem_objects,
  125. cl_uint num_events_in_wait_list,
  126. const cl_event * event_wait_list,
  127. cl_event * event
  128. ): TCL_int;
  129. {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF};
  130. TclEnqueueReleaseD3D11ObjectsKHR_fn = function (
  131. cl_command_queue command_queue,
  132. cl_uint num_objects,
  133. const cl_mem * mem_objects,
  134. cl_uint num_events_in_wait_list,
  135. const cl_event * event_wait_list,
  136. cl_event * event
  137. ): TCL_int;
  138. {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF};
  139. {$ENDIF}
  140. implementation
  141. end.