cl_d3d11_ext.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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_D3D11_EXT_H
  24. #define __OPENCL_CL_D3D11_EXT_H
  25. #include <d3d11.h>
  26. #include <CL/cl.h>
  27. #include <CL/cl_platform.h>
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /******************************************************************************
  32. * cl_nv_d3d11_sharing */
  33. typedef cl_uint cl_d3d11_device_source_nv;
  34. typedef cl_uint cl_d3d11_device_set_nv;
  35. /******************************************************************************/
  36. // Error Codes
  37. #define CL_INVALID_D3D11_DEVICE_NV -1006
  38. #define CL_INVALID_D3D11_RESOURCE_NV -1007
  39. #define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_NV -1008
  40. #define CL_D3D11_RESOURCE_NOT_ACQUIRED_NV -1009
  41. // cl_d3d11_device_source_nv
  42. #define CL_D3D11_DEVICE_NV 0x4019
  43. #define CL_D3D11_DXGI_ADAPTER_NV 0x401A
  44. // cl_d3d11_device_set_nv
  45. #define CL_PREFERRED_DEVICES_FOR_D3D11_NV 0x401B
  46. #define CL_ALL_DEVICES_FOR_D3D11_NV 0x401C
  47. // cl_context_info
  48. #define CL_CONTEXT_D3D11_DEVICE_NV 0x401D
  49. // cl_mem_info
  50. #define CL_MEM_D3D11_RESOURCE_NV 0x401E
  51. // cl_image_info
  52. #define CL_IMAGE_D3D11_SUBRESOURCE_NV 0x401F
  53. // cl_command_type
  54. #define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_NV 0x4020
  55. #define CL_COMMAND_RELEASE_D3D11_OBJECTS_NV 0x4021
  56. /******************************************************************************/
  57. typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11NV_fn)(
  58. cl_platform_id platform,
  59. cl_d3d11_device_source_nv d3d_device_source,
  60. void * d3d_object,
  61. cl_d3d11_device_set_nv d3d_device_set,
  62. cl_uint num_entries,
  63. cl_device_id * devices,
  64. cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
  65. typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferNV_fn)(
  66. cl_context context,
  67. cl_mem_flags flags,
  68. ID3D11Buffer * resource,
  69. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  70. typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DNV_fn)(
  71. cl_context context,
  72. cl_mem_flags flags,
  73. ID3D11Texture2D * resource,
  74. UINT subresource,
  75. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  76. typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DNV_fn)(
  77. cl_context context,
  78. cl_mem_flags flags,
  79. ID3D11Texture3D * resource,
  80. UINT subresource,
  81. cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
  82. typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsNV_fn)(
  83. cl_command_queue command_queue,
  84. cl_uint num_objects,
  85. const cl_mem * mem_objects,
  86. cl_uint num_events_in_wait_list,
  87. const cl_event * event_wait_list,
  88. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  89. typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsNV_fn)(
  90. cl_command_queue command_queue,
  91. cl_uint num_objects,
  92. cl_mem * mem_objects,
  93. cl_uint num_events_in_wait_list,
  94. const cl_event * event_wait_list,
  95. cl_event * event) CL_API_SUFFIX__VERSION_1_0;
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99. #endif // __OPENCL_CL_D3D11_H