cl_d3d10.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /**********************************************************************************
  2. * Copyright (c) 2008-2012 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: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
  24. #ifndef __OPENCL_CL_D3D10_H
  25. #define __OPENCL_CL_D3D10_H
  26. #include <d3d10.h>
  27. #include <CL/cl.h>
  28. #include <CL/cl_platform.h>
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /******************************************************************************
  33. * cl_khr_d3d10_sharing */
  34. #define cl_khr_d3d10_sharing 1
  35. typedef cl_uint cl_d3d10_device_source_khr;
  36. typedef cl_uint cl_d3d10_device_set_khr;
  37. /******************************************************************************/
  38. // Error Codes
  39. #define CL_INVALID_D3D10_DEVICE_KHR -1002
  40. #define CL_INVALID_D3D10_RESOURCE_KHR -1003
  41. #define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004
  42. #define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005
  43. // cl_d3d10_device_source_nv
  44. #define CL_D3D10_DEVICE_KHR 0x4010
  45. #define CL_D3D10_DXGI_ADAPTER_KHR 0x4011
  46. // cl_d3d10_device_set_nv
  47. #define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012
  48. #define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013
  49. // cl_context_info
  50. #define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014
  51. #define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
  52. // cl_mem_info
  53. #define CL_MEM_D3D10_RESOURCE_KHR 0x4015
  54. // cl_image_info
  55. #define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016
  56. // cl_command_type
  57. #define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017
  58. #define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
  59. /******************************************************************************/
  60. typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
  61. cl_platform_id platform,
  62. cl_d3d10_device_source_khr d3d_device_source,
  63. void * d3d_object,
  64. cl_d3d10_device_set_khr d3d_device_set,
  65. cl_uint num_entries,
  66. cl_device_id * devices,
  67. cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
  68. typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
  69. cl_context context,
  70. cl_mem_flags flags,
  71. ID3D10Buffer * resource,
  72. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  73. typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
  74. cl_context context,
  75. cl_mem_flags flags,
  76. ID3D10Texture2D * resource,
  77. UINT subresource,
  78. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  79. typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
  80. cl_context context,
  81. cl_mem_flags flags,
  82. ID3D10Texture3D * resource,
  83. UINT subresource,
  84. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  85. typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
  86. cl_command_queue command_queue,
  87. cl_uint num_objects,
  88. const cl_mem * mem_objects,
  89. cl_uint num_events_in_wait_list,
  90. const cl_event * event_wait_list,
  91. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  92. typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
  93. cl_command_queue command_queue,
  94. cl_uint num_objects,
  95. const cl_mem * mem_objects,
  96. cl_uint num_events_in_wait_list,
  97. const cl_event * event_wait_list,
  98. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102. #endif // __OPENCL_CL_D3D10_H