1 /******************************************************************************* 2 * Copyright (c) 2008-2023 The Khronos Group Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 ******************************************************************************/ 16 17 #ifndef OPENCL_CL_D3D11_H_ 18 #define OPENCL_CL_D3D11_H_ 19 20 /* 21 ** This header is generated from the Khronos OpenCL XML API Registry. 22 */ 23 24 #if defined(_MSC_VER) 25 #if _MSC_VER >=1500 26 #pragma warning( push ) 27 #pragma warning( disable : 4201 ) 28 #pragma warning( disable : 5105 ) 29 #endif 30 #endif 31 #include <d3d11.h> 32 #if defined(_MSC_VER) 33 #if _MSC_VER >=1500 34 #pragma warning( pop ) 35 #endif 36 #endif 37 38 #include <CL/cl.h> 39 40 /* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */ 41 #if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) 42 #define CL_NO_EXTENSION_PROTOTYPES 43 #endif 44 45 /* CL_NO_EXTENSION_PROTOTYPES implies 46 CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and 47 CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */ 48 #if defined(CL_NO_EXTENSION_PROTOTYPES) && \ 49 !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) 50 #define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES 51 #endif 52 #if defined(CL_NO_EXTENSION_PROTOTYPES) && \ 53 !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) 54 #define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES 55 #endif 56 57 #ifdef __cplusplus 58 extern "C" { 59 #endif 60 61 /*************************************************************** 62 * cl_khr_d3d11_sharing 63 ***************************************************************/ 64 #define cl_khr_d3d11_sharing 1 65 #define CL_KHR_D3D11_SHARING_EXTENSION_NAME \ 66 "cl_khr_d3d11_sharing" 67 68 69 #define CL_KHR_D3D11_SHARING_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0) 70 71 typedef cl_uint cl_d3d11_device_source_khr; 72 typedef cl_uint cl_d3d11_device_set_khr; 73 74 /* Error codes */ 75 #define CL_INVALID_D3D11_DEVICE_KHR -1006 76 #define CL_INVALID_D3D11_RESOURCE_KHR -1007 77 #define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008 78 #define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009 79 80 /* cl_d3d11_device_source_khr */ 81 #define CL_D3D11_DEVICE_KHR 0x4019 82 #define CL_D3D11_DXGI_ADAPTER_KHR 0x401A 83 84 /* cl_d3d11_device_set_khr */ 85 #define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B 86 #define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C 87 88 /* cl_context_info */ 89 #define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D 90 #define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D 91 92 /* cl_mem_info */ 93 #define CL_MEM_D3D11_RESOURCE_KHR 0x401E 94 95 /* cl_image_info */ 96 #define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F 97 98 /* cl_command_type */ 99 #define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020 100 #define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021 101 102 103 typedef cl_int CL_API_CALL 104 clGetDeviceIDsFromD3D11KHR_t( 105 cl_platform_id platform, 106 cl_d3d11_device_source_khr d3d_device_source, 107 void* d3d_object, 108 cl_d3d11_device_set_khr d3d_device_set, 109 cl_uint num_entries, 110 cl_device_id* devices, 111 cl_uint* num_devices); 112 113 typedef clGetDeviceIDsFromD3D11KHR_t * 114 clGetDeviceIDsFromD3D11KHR_fn CL_API_SUFFIX__VERSION_1_2; 115 116 typedef cl_mem CL_API_CALL 117 clCreateFromD3D11BufferKHR_t( 118 cl_context context, 119 cl_mem_flags flags, 120 ID3D11Buffer* resource, 121 cl_int* errcode_ret); 122 123 typedef clCreateFromD3D11BufferKHR_t * 124 clCreateFromD3D11BufferKHR_fn CL_API_SUFFIX__VERSION_1_2; 125 126 typedef cl_mem CL_API_CALL 127 clCreateFromD3D11Texture2DKHR_t( 128 cl_context context, 129 cl_mem_flags flags, 130 ID3D11Texture2D* resource, 131 UINT subresource, 132 cl_int* errcode_ret); 133 134 typedef clCreateFromD3D11Texture2DKHR_t * 135 clCreateFromD3D11Texture2DKHR_fn CL_API_SUFFIX__VERSION_1_2; 136 137 typedef cl_mem CL_API_CALL 138 clCreateFromD3D11Texture3DKHR_t( 139 cl_context context, 140 cl_mem_flags flags, 141 ID3D11Texture3D* resource, 142 UINT subresource, 143 cl_int* errcode_ret); 144 145 typedef clCreateFromD3D11Texture3DKHR_t * 146 clCreateFromD3D11Texture3DKHR_fn CL_API_SUFFIX__VERSION_1_2; 147 148 typedef cl_int CL_API_CALL 149 clEnqueueAcquireD3D11ObjectsKHR_t( 150 cl_command_queue command_queue, 151 cl_uint num_objects, 152 const cl_mem* mem_objects, 153 cl_uint num_events_in_wait_list, 154 const cl_event* event_wait_list, 155 cl_event* event); 156 157 typedef clEnqueueAcquireD3D11ObjectsKHR_t * 158 clEnqueueAcquireD3D11ObjectsKHR_fn CL_API_SUFFIX__VERSION_1_2; 159 160 typedef cl_int CL_API_CALL 161 clEnqueueReleaseD3D11ObjectsKHR_t( 162 cl_command_queue command_queue, 163 cl_uint num_objects, 164 const cl_mem* mem_objects, 165 cl_uint num_events_in_wait_list, 166 const cl_event* event_wait_list, 167 cl_event* event); 168 169 typedef clEnqueueReleaseD3D11ObjectsKHR_t * 170 clEnqueueReleaseD3D11ObjectsKHR_fn CL_API_SUFFIX__VERSION_1_2; 171 172 #if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) 173 174 extern CL_API_ENTRY cl_int CL_API_CALL 175 clGetDeviceIDsFromD3D11KHR( 176 cl_platform_id platform, 177 cl_d3d11_device_source_khr d3d_device_source, 178 void* d3d_object, 179 cl_d3d11_device_set_khr d3d_device_set, 180 cl_uint num_entries, 181 cl_device_id* devices, 182 cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; 183 184 extern CL_API_ENTRY cl_mem CL_API_CALL 185 clCreateFromD3D11BufferKHR( 186 cl_context context, 187 cl_mem_flags flags, 188 ID3D11Buffer* resource, 189 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; 190 191 extern CL_API_ENTRY cl_mem CL_API_CALL 192 clCreateFromD3D11Texture2DKHR( 193 cl_context context, 194 cl_mem_flags flags, 195 ID3D11Texture2D* resource, 196 UINT subresource, 197 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; 198 199 extern CL_API_ENTRY cl_mem CL_API_CALL 200 clCreateFromD3D11Texture3DKHR( 201 cl_context context, 202 cl_mem_flags flags, 203 ID3D11Texture3D* resource, 204 UINT subresource, 205 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; 206 207 extern CL_API_ENTRY cl_int CL_API_CALL 208 clEnqueueAcquireD3D11ObjectsKHR( 209 cl_command_queue command_queue, 210 cl_uint num_objects, 211 const cl_mem* mem_objects, 212 cl_uint num_events_in_wait_list, 213 const cl_event* event_wait_list, 214 cl_event* event) CL_API_SUFFIX__VERSION_1_2; 215 216 extern CL_API_ENTRY cl_int CL_API_CALL 217 clEnqueueReleaseD3D11ObjectsKHR( 218 cl_command_queue command_queue, 219 cl_uint num_objects, 220 const cl_mem* mem_objects, 221 cl_uint num_events_in_wait_list, 222 const cl_event* event_wait_list, 223 cl_event* event) CL_API_SUFFIX__VERSION_1_2; 224 225 #endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ 226 227 /*************************************************************** 228 * cl_intel_sharing_format_query_d3d11 229 ***************************************************************/ 230 #define cl_intel_sharing_format_query_d3d11 1 231 #define CL_INTEL_SHARING_FORMAT_QUERY_D3D11_EXTENSION_NAME \ 232 "cl_intel_sharing_format_query_d3d11" 233 234 235 #define CL_INTEL_SHARING_FORMAT_QUERY_D3D11_EXTENSION_VERSION CL_MAKE_VERSION(0, 0, 0) 236 237 /* when cl_khr_d3d11_sharing is supported */ 238 239 typedef cl_int CL_API_CALL 240 clGetSupportedD3D11TextureFormatsINTEL_t( 241 cl_context context, 242 cl_mem_flags flags, 243 cl_mem_object_type image_type, 244 cl_uint plane, 245 cl_uint num_entries, 246 DXGI_FORMAT* d3d11_formats, 247 cl_uint* num_texture_formats); 248 249 typedef clGetSupportedD3D11TextureFormatsINTEL_t * 250 clGetSupportedD3D11TextureFormatsINTEL_fn ; 251 252 #if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) 253 254 extern CL_API_ENTRY cl_int CL_API_CALL 255 clGetSupportedD3D11TextureFormatsINTEL( 256 cl_context context, 257 cl_mem_flags flags, 258 cl_mem_object_type image_type, 259 cl_uint plane, 260 cl_uint num_entries, 261 DXGI_FORMAT* d3d11_formats, 262 cl_uint* num_texture_formats) ; 263 264 #endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ 265 266 #ifdef __cplusplus 267 } 268 #endif 269 270 #endif /* OPENCL_CL_D3D11_H_ */ 271