Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 1 | /******************************************************************************* |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 2 | * Copyright (c) 2008-2023 The Khronos Group Inc. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 3 | * |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 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 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 7 | * |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 9 | * |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 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 | ******************************************************************************/ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 16 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 17 | #ifndef OPENCL_CL_D3D10_H_ |
| 18 | #define OPENCL_CL_D3D10_H_ |
| 19 | |
| 20 | /* |
| 21 | ** This header is generated from the Khronos OpenCL XML API Registry. |
| 22 | */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 23 | |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 24 | #if defined(_MSC_VER) |
| 25 | #if _MSC_VER >=1500 |
| 26 | #pragma warning( push ) |
| 27 | #pragma warning( disable : 4201 ) |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 28 | #pragma warning( disable : 5105 ) |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 29 | #endif |
| 30 | #endif |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 31 | #include <d3d10.h> |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 32 | #if defined(_MSC_VER) |
| 33 | #if _MSC_VER >=1500 |
| 34 | #pragma warning( pop ) |
| 35 | #endif |
| 36 | #endif |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 37 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 38 | #include <CL/cl.h> |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 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 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 56 | |
| 57 | #ifdef __cplusplus |
| 58 | extern "C" { |
| 59 | #endif |
| 60 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 61 | /*************************************************************** |
| 62 | * cl_khr_d3d10_sharing |
| 63 | ***************************************************************/ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 64 | #define cl_khr_d3d10_sharing 1 |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 65 | #define CL_KHR_D3D10_SHARING_EXTENSION_NAME \ |
| 66 | "cl_khr_d3d10_sharing" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 67 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 68 | typedef cl_uint cl_d3d10_device_source_khr; |
| 69 | typedef cl_uint cl_d3d10_device_set_khr; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 70 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 71 | /* Error codes */ |
| 72 | #define CL_INVALID_D3D10_DEVICE_KHR -1002 |
| 73 | #define CL_INVALID_D3D10_RESOURCE_KHR -1003 |
| 74 | #define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004 |
| 75 | #define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 76 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 77 | /* cl_d3d10_device_source_khr */ |
| 78 | #define CL_D3D10_DEVICE_KHR 0x4010 |
| 79 | #define CL_D3D10_DXGI_ADAPTER_KHR 0x4011 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 80 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 81 | /* cl_d3d10_device_set_khr */ |
| 82 | #define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012 |
| 83 | #define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 84 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 85 | /* cl_context_info */ |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 86 | #define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 |
| 87 | #define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 88 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 89 | /* cl_mem_info */ |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 90 | #define CL_MEM_D3D10_RESOURCE_KHR 0x4015 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 91 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 92 | /* cl_image_info */ |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 93 | #define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 94 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 95 | /* cl_command_type */ |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 96 | #define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017 |
| 97 | #define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018 |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 98 | |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 99 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 100 | typedef cl_int (CL_API_CALL * |
| 101 | clGetDeviceIDsFromD3D10KHR_fn)( |
| 102 | cl_platform_id platform, |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 103 | cl_d3d10_device_source_khr d3d_device_source, |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 104 | void* d3d_object, |
| 105 | cl_d3d10_device_set_khr d3d_device_set, |
| 106 | cl_uint num_entries, |
| 107 | cl_device_id* devices, |
| 108 | cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_0; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 109 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 110 | typedef cl_mem (CL_API_CALL * |
| 111 | clCreateFromD3D10BufferKHR_fn)( |
| 112 | cl_context context, |
| 113 | cl_mem_flags flags, |
| 114 | ID3D10Buffer* resource, |
| 115 | cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 116 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 117 | typedef cl_mem (CL_API_CALL * |
| 118 | clCreateFromD3D10Texture2DKHR_fn)( |
| 119 | cl_context context, |
| 120 | cl_mem_flags flags, |
| 121 | ID3D10Texture2D* resource, |
| 122 | UINT subresource, |
| 123 | cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 124 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 125 | typedef cl_mem (CL_API_CALL * |
| 126 | clCreateFromD3D10Texture3DKHR_fn)( |
| 127 | cl_context context, |
| 128 | cl_mem_flags flags, |
| 129 | ID3D10Texture3D* resource, |
| 130 | UINT subresource, |
| 131 | cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 132 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 133 | typedef cl_int (CL_API_CALL * |
| 134 | clEnqueueAcquireD3D10ObjectsKHR_fn)( |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 135 | cl_command_queue command_queue, |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 136 | cl_uint num_objects, |
| 137 | const cl_mem* mem_objects, |
| 138 | cl_uint num_events_in_wait_list, |
| 139 | const cl_event* event_wait_list, |
| 140 | cl_event* event) CL_API_SUFFIX__VERSION_1_0; |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 141 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 142 | typedef cl_int (CL_API_CALL * |
| 143 | clEnqueueReleaseD3D10ObjectsKHR_fn)( |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 144 | cl_command_queue command_queue, |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 145 | cl_uint num_objects, |
| 146 | const cl_mem* mem_objects, |
| 147 | cl_uint num_events_in_wait_list, |
| 148 | const cl_event* event_wait_list, |
| 149 | cl_event* event) CL_API_SUFFIX__VERSION_1_0; |
| 150 | |
| 151 | #if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) |
| 152 | |
| 153 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 154 | clGetDeviceIDsFromD3D10KHR( |
| 155 | cl_platform_id platform, |
| 156 | cl_d3d10_device_source_khr d3d_device_source, |
| 157 | void* d3d_object, |
| 158 | cl_d3d10_device_set_khr d3d_device_set, |
| 159 | cl_uint num_entries, |
| 160 | cl_device_id* devices, |
| 161 | cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_0; |
| 162 | |
| 163 | extern CL_API_ENTRY cl_mem CL_API_CALL |
| 164 | clCreateFromD3D10BufferKHR( |
| 165 | cl_context context, |
| 166 | cl_mem_flags flags, |
| 167 | ID3D10Buffer* resource, |
| 168 | cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
| 169 | |
| 170 | extern CL_API_ENTRY cl_mem CL_API_CALL |
| 171 | clCreateFromD3D10Texture2DKHR( |
| 172 | cl_context context, |
| 173 | cl_mem_flags flags, |
| 174 | ID3D10Texture2D* resource, |
| 175 | UINT subresource, |
| 176 | cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
| 177 | |
| 178 | extern CL_API_ENTRY cl_mem CL_API_CALL |
| 179 | clCreateFromD3D10Texture3DKHR( |
| 180 | cl_context context, |
| 181 | cl_mem_flags flags, |
| 182 | ID3D10Texture3D* resource, |
| 183 | UINT subresource, |
| 184 | cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
| 185 | |
| 186 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 187 | clEnqueueAcquireD3D10ObjectsKHR( |
| 188 | cl_command_queue command_queue, |
| 189 | cl_uint num_objects, |
| 190 | const cl_mem* mem_objects, |
| 191 | cl_uint num_events_in_wait_list, |
| 192 | const cl_event* event_wait_list, |
| 193 | cl_event* event) CL_API_SUFFIX__VERSION_1_0; |
| 194 | |
| 195 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 196 | clEnqueueReleaseD3D10ObjectsKHR( |
| 197 | cl_command_queue command_queue, |
| 198 | cl_uint num_objects, |
| 199 | const cl_mem* mem_objects, |
| 200 | cl_uint num_events_in_wait_list, |
| 201 | const cl_event* event_wait_list, |
| 202 | cl_event* event) CL_API_SUFFIX__VERSION_1_0; |
| 203 | |
| 204 | #endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ |
| 205 | |
| 206 | /*************************************************************** |
| 207 | * cl_intel_sharing_format_query_d3d10 |
| 208 | ***************************************************************/ |
| 209 | #define cl_intel_sharing_format_query_d3d10 1 |
| 210 | #define CL_INTEL_SHARING_FORMAT_QUERY_D3D10_EXTENSION_NAME \ |
| 211 | "cl_intel_sharing_format_query_d3d10" |
| 212 | |
| 213 | /* when cl_khr_d3d10_sharing is supported */ |
| 214 | |
| 215 | typedef cl_int (CL_API_CALL * |
| 216 | clGetSupportedD3D10TextureFormatsINTEL_fn)( |
| 217 | cl_context context, |
| 218 | cl_mem_flags flags, |
| 219 | cl_mem_object_type image_type, |
| 220 | cl_uint num_entries, |
| 221 | DXGI_FORMAT* d3d10_formats, |
| 222 | cl_uint* num_texture_formats) ; |
| 223 | |
| 224 | #if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) |
| 225 | |
| 226 | extern CL_API_ENTRY cl_int CL_API_CALL |
| 227 | clGetSupportedD3D10TextureFormatsINTEL( |
| 228 | cl_context context, |
| 229 | cl_mem_flags flags, |
| 230 | cl_mem_object_type image_type, |
| 231 | cl_uint num_entries, |
| 232 | DXGI_FORMAT* d3d10_formats, |
| 233 | cl_uint* num_texture_formats) ; |
| 234 | |
| 235 | #endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 236 | |
| 237 | #ifdef __cplusplus |
| 238 | } |
| 239 | #endif |
| 240 | |
Viet-Hoa Do | 633ebd1 | 2023-08-11 12:27:59 +0100 | [diff] [blame] | 241 | #endif /* OPENCL_CL_D3D10_H_ */ |