blob: 6a6af21dc78fd87c849a55a89dd945aaa966bf34 [file] [log] [blame]
Sheri Zhang79cb9452021-09-07 14:51:49 +01001/*******************************************************************************
Viet-Hoa Do633ebd12023-08-11 12:27:59 +01002 * Copyright (c) 2008-2023 The Khronos Group Inc.
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01004 * 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 Barbier6ff3b192017-09-04 18:44:23 +01007 *
Sheri Zhang79cb9452021-09-07 14:51:49 +01008 * http://www.apache.org/licenses/LICENSE-2.0
Anthony Barbier6ff3b192017-09-04 18:44:23 +01009 *
Sheri Zhang79cb9452021-09-07 14:51:49 +010010 * 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 Barbier6ff3b192017-09-04 18:44:23 +010016
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010017#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*/
Anthony Barbier6ff3b192017-09-04 18:44:23 +010023
Sheri Zhang79cb9452021-09-07 14:51:49 +010024#if defined(_MSC_VER)
25#if _MSC_VER >=1500
26#pragma warning( push )
27#pragma warning( disable : 4201 )
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010028#pragma warning( disable : 5105 )
Sheri Zhang79cb9452021-09-07 14:51:49 +010029#endif
30#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010031#include <d3d11.h>
Sheri Zhang79cb9452021-09-07 14:51:49 +010032#if defined(_MSC_VER)
33#if _MSC_VER >=1500
34#pragma warning( pop )
35#endif
36#endif
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010037
Anthony Barbier6ff3b192017-09-04 18:44:23 +010038#include <CL/cl.h>
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010039
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 Barbier6ff3b192017-09-04 18:44:23 +010056
57#ifdef __cplusplus
58extern "C" {
59#endif
60
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010061/***************************************************************
62* cl_khr_d3d11_sharing
63***************************************************************/
Anthony Barbier6ff3b192017-09-04 18:44:23 +010064#define cl_khr_d3d11_sharing 1
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010065#define CL_KHR_D3D11_SHARING_EXTENSION_NAME \
66 "cl_khr_d3d11_sharing"
Anthony Barbier6ff3b192017-09-04 18:44:23 +010067
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010068typedef cl_uint cl_d3d11_device_source_khr;
69typedef cl_uint cl_d3d11_device_set_khr;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010070
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010071/* Error codes */
72#define CL_INVALID_D3D11_DEVICE_KHR -1006
73#define CL_INVALID_D3D11_RESOURCE_KHR -1007
74#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008
75#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009
Anthony Barbier6ff3b192017-09-04 18:44:23 +010076
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010077/* cl_d3d11_device_source_khr */
78#define CL_D3D11_DEVICE_KHR 0x4019
79#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A
Anthony Barbier6ff3b192017-09-04 18:44:23 +010080
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010081/* cl_d3d11_device_set_khr */
82#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B
83#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C
Anthony Barbier6ff3b192017-09-04 18:44:23 +010084
Pablo Telloe86a09f2018-01-11 15:44:48 +000085/* cl_context_info */
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010086#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D
87#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
Anthony Barbier6ff3b192017-09-04 18:44:23 +010088
Pablo Telloe86a09f2018-01-11 15:44:48 +000089/* cl_mem_info */
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010090#define CL_MEM_D3D11_RESOURCE_KHR 0x401E
Anthony Barbier6ff3b192017-09-04 18:44:23 +010091
Pablo Telloe86a09f2018-01-11 15:44:48 +000092/* cl_image_info */
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010093#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F
Anthony Barbier6ff3b192017-09-04 18:44:23 +010094
Pablo Telloe86a09f2018-01-11 15:44:48 +000095/* cl_command_type */
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010096#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020
97#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021
Anthony Barbier6ff3b192017-09-04 18:44:23 +010098
Anthony Barbier6ff3b192017-09-04 18:44:23 +010099
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100100typedef cl_int (CL_API_CALL *
101clGetDeviceIDsFromD3D11KHR_fn)(
102 cl_platform_id platform,
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100103 cl_d3d11_device_source_khr d3d_device_source,
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100104 void* d3d_object,
105 cl_d3d11_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_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100109
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100110typedef cl_mem (CL_API_CALL *
111clCreateFromD3D11BufferKHR_fn)(
112 cl_context context,
113 cl_mem_flags flags,
114 ID3D11Buffer* resource,
115 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100116
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100117typedef cl_mem (CL_API_CALL *
118clCreateFromD3D11Texture2DKHR_fn)(
119 cl_context context,
120 cl_mem_flags flags,
121 ID3D11Texture2D* resource,
122 UINT subresource,
123 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100124
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100125typedef cl_mem (CL_API_CALL *
126clCreateFromD3D11Texture3DKHR_fn)(
127 cl_context context,
128 cl_mem_flags flags,
129 ID3D11Texture3D* resource,
130 UINT subresource,
131 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100132
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100133typedef cl_int (CL_API_CALL *
134clEnqueueAcquireD3D11ObjectsKHR_fn)(
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100135 cl_command_queue command_queue,
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100136 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_2;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100141
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100142typedef cl_int (CL_API_CALL *
143clEnqueueReleaseD3D11ObjectsKHR_fn)(
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100144 cl_command_queue command_queue,
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100145 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_2;
150
151#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
152
153extern CL_API_ENTRY cl_int CL_API_CALL
154clGetDeviceIDsFromD3D11KHR(
155 cl_platform_id platform,
156 cl_d3d11_device_source_khr d3d_device_source,
157 void* d3d_object,
158 cl_d3d11_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_2;
162
163extern CL_API_ENTRY cl_mem CL_API_CALL
164clCreateFromD3D11BufferKHR(
165 cl_context context,
166 cl_mem_flags flags,
167 ID3D11Buffer* resource,
168 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
169
170extern CL_API_ENTRY cl_mem CL_API_CALL
171clCreateFromD3D11Texture2DKHR(
172 cl_context context,
173 cl_mem_flags flags,
174 ID3D11Texture2D* resource,
175 UINT subresource,
176 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
177
178extern CL_API_ENTRY cl_mem CL_API_CALL
179clCreateFromD3D11Texture3DKHR(
180 cl_context context,
181 cl_mem_flags flags,
182 ID3D11Texture3D* resource,
183 UINT subresource,
184 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
185
186extern CL_API_ENTRY cl_int CL_API_CALL
187clEnqueueAcquireD3D11ObjectsKHR(
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_2;
194
195extern CL_API_ENTRY cl_int CL_API_CALL
196clEnqueueReleaseD3D11ObjectsKHR(
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_2;
203
204#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
205
206/***************************************************************
207* cl_intel_sharing_format_query_d3d11
208***************************************************************/
209#define cl_intel_sharing_format_query_d3d11 1
210#define CL_INTEL_SHARING_FORMAT_QUERY_D3D11_EXTENSION_NAME \
211 "cl_intel_sharing_format_query_d3d11"
212
213/* when cl_khr_d3d11_sharing is supported */
214
215typedef cl_int (CL_API_CALL *
216clGetSupportedD3D11TextureFormatsINTEL_fn)(
217 cl_context context,
218 cl_mem_flags flags,
219 cl_mem_object_type image_type,
220 cl_uint plane,
221 cl_uint num_entries,
222 DXGI_FORMAT* d3d11_formats,
223 cl_uint* num_texture_formats) ;
224
225#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
226
227extern CL_API_ENTRY cl_int CL_API_CALL
228clGetSupportedD3D11TextureFormatsINTEL(
229 cl_context context,
230 cl_mem_flags flags,
231 cl_mem_object_type image_type,
232 cl_uint plane,
233 cl_uint num_entries,
234 DXGI_FORMAT* d3d11_formats,
235 cl_uint* num_texture_formats) ;
236
237#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100238
239#ifdef __cplusplus
240}
241#endif
242
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100243#endif /* OPENCL_CL_D3D11_H_ */