Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2008-2020 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 | |
| 17 | #ifndef __OPENCL_CL_D3D10_H |
| 18 | #define __OPENCL_CL_D3D10_H |
| 19 | |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 20 | #if defined(_MSC_VER) |
| 21 | #if _MSC_VER >=1500 |
| 22 | #pragma warning( push ) |
| 23 | #pragma warning( disable : 4201 ) |
| 24 | #endif |
| 25 | #endif |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 26 | #include <d3d10.h> |
Sheri Zhang | 79cb945 | 2021-09-07 14:51:49 +0100 | [diff] [blame] | 27 | #if defined(_MSC_VER) |
| 28 | #if _MSC_VER >=1500 |
| 29 | #pragma warning( pop ) |
| 30 | #endif |
| 31 | #endif |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 32 | #include <CL/cl.h> |
| 33 | #include <CL/cl_platform.h> |
| 34 | |
| 35 | #ifdef __cplusplus |
| 36 | extern "C" { |
| 37 | #endif |
| 38 | |
| 39 | /****************************************************************************** |
| 40 | * cl_khr_d3d10_sharing */ |
| 41 | #define cl_khr_d3d10_sharing 1 |
| 42 | |
| 43 | typedef cl_uint cl_d3d10_device_source_khr; |
| 44 | typedef cl_uint cl_d3d10_device_set_khr; |
| 45 | |
| 46 | /******************************************************************************/ |
| 47 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 48 | /* Error Codes */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 49 | #define CL_INVALID_D3D10_DEVICE_KHR -1002 |
| 50 | #define CL_INVALID_D3D10_RESOURCE_KHR -1003 |
| 51 | #define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004 |
| 52 | #define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005 |
| 53 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 54 | /* cl_d3d10_device_source_nv */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 55 | #define CL_D3D10_DEVICE_KHR 0x4010 |
| 56 | #define CL_D3D10_DXGI_ADAPTER_KHR 0x4011 |
| 57 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 58 | /* cl_d3d10_device_set_nv */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 59 | #define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012 |
| 60 | #define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013 |
| 61 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 62 | /* cl_context_info */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 63 | #define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 |
| 64 | #define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C |
| 65 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 66 | /* cl_mem_info */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 67 | #define CL_MEM_D3D10_RESOURCE_KHR 0x4015 |
| 68 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 69 | /* cl_image_info */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 70 | #define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016 |
| 71 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 72 | /* cl_command_type */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 73 | #define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017 |
| 74 | #define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018 |
| 75 | |
| 76 | /******************************************************************************/ |
| 77 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 78 | typedef cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)( |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 79 | cl_platform_id platform, |
| 80 | cl_d3d10_device_source_khr d3d_device_source, |
| 81 | void * d3d_object, |
| 82 | cl_d3d10_device_set_khr d3d_device_set, |
| 83 | cl_uint num_entries, |
| 84 | cl_device_id * devices, |
| 85 | cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; |
| 86 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 87 | typedef cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)( |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 88 | cl_context context, |
| 89 | cl_mem_flags flags, |
| 90 | ID3D10Buffer * resource, |
| 91 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
| 92 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 93 | typedef cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)( |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 94 | cl_context context, |
| 95 | cl_mem_flags flags, |
| 96 | ID3D10Texture2D * resource, |
| 97 | UINT subresource, |
| 98 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
| 99 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 100 | typedef cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)( |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 101 | cl_context context, |
| 102 | cl_mem_flags flags, |
| 103 | ID3D10Texture3D * resource, |
| 104 | UINT subresource, |
| 105 | cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
| 106 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 107 | typedef cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)( |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 108 | cl_command_queue command_queue, |
| 109 | cl_uint num_objects, |
| 110 | const cl_mem * mem_objects, |
| 111 | cl_uint num_events_in_wait_list, |
| 112 | const cl_event * event_wait_list, |
| 113 | cl_event * event) CL_API_SUFFIX__VERSION_1_0; |
| 114 | |
Pablo Marquez Tello | dc2282f | 2021-11-23 15:16:00 +0000 | [diff] [blame] | 115 | typedef cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)( |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 116 | cl_command_queue command_queue, |
| 117 | cl_uint num_objects, |
| 118 | const cl_mem * mem_objects, |
| 119 | cl_uint num_events_in_wait_list, |
| 120 | const cl_event * event_wait_list, |
| 121 | cl_event * event) CL_API_SUFFIX__VERSION_1_0; |
| 122 | |
| 123 | #ifdef __cplusplus |
| 124 | } |
| 125 | #endif |
| 126 | |
Pablo Tello | e86a09f | 2018-01-11 15:44:48 +0000 | [diff] [blame] | 127 | #endif /* __OPENCL_CL_D3D10_H */ |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 128 | |