blob: 3d8fe131281cd2e9094719dce2497a57acce6607 [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_D3D10_H_
18#define OPENCL_CL_D3D10_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 <d3d10.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_d3d10_sharing
63***************************************************************/
Anthony Barbier6ff3b192017-09-04 18:44:23 +010064#define cl_khr_d3d10_sharing 1
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010065#define CL_KHR_D3D10_SHARING_EXTENSION_NAME \
66 "cl_khr_d3d10_sharing"
Anthony Barbier6ff3b192017-09-04 18:44:23 +010067
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010068typedef cl_uint cl_d3d10_device_source_khr;
69typedef cl_uint cl_d3d10_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_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 Barbier6ff3b192017-09-04 18:44:23 +010076
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010077/* cl_d3d10_device_source_khr */
78#define CL_D3D10_DEVICE_KHR 0x4010
79#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011
Anthony Barbier6ff3b192017-09-04 18:44:23 +010080
Viet-Hoa Do633ebd12023-08-11 12:27:59 +010081/* cl_d3d10_device_set_khr */
82#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012
83#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013
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_D3D10_DEVICE_KHR 0x4014
87#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
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_D3D10_RESOURCE_KHR 0x4015
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_D3D10_SUBRESOURCE_KHR 0x4016
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_D3D10_OBJECTS_KHR 0x4017
97#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
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 *
101clGetDeviceIDsFromD3D10KHR_fn)(
102 cl_platform_id platform,
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100103 cl_d3d10_device_source_khr d3d_device_source,
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100104 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 Barbier6ff3b192017-09-04 18:44:23 +0100109
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100110typedef cl_mem (CL_API_CALL *
111clCreateFromD3D10BufferKHR_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 Barbier6ff3b192017-09-04 18:44:23 +0100116
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100117typedef cl_mem (CL_API_CALL *
118clCreateFromD3D10Texture2DKHR_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 Barbier6ff3b192017-09-04 18:44:23 +0100124
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100125typedef cl_mem (CL_API_CALL *
126clCreateFromD3D10Texture3DKHR_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 Barbier6ff3b192017-09-04 18:44:23 +0100132
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100133typedef cl_int (CL_API_CALL *
134clEnqueueAcquireD3D10ObjectsKHR_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_0;
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100141
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100142typedef cl_int (CL_API_CALL *
143clEnqueueReleaseD3D10ObjectsKHR_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_0;
150
151#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
152
153extern CL_API_ENTRY cl_int CL_API_CALL
154clGetDeviceIDsFromD3D10KHR(
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
163extern CL_API_ENTRY cl_mem CL_API_CALL
164clCreateFromD3D10BufferKHR(
165 cl_context context,
166 cl_mem_flags flags,
167 ID3D10Buffer* resource,
168 cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
169
170extern CL_API_ENTRY cl_mem CL_API_CALL
171clCreateFromD3D10Texture2DKHR(
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
178extern CL_API_ENTRY cl_mem CL_API_CALL
179clCreateFromD3D10Texture3DKHR(
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
186extern CL_API_ENTRY cl_int CL_API_CALL
187clEnqueueAcquireD3D10ObjectsKHR(
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
195extern CL_API_ENTRY cl_int CL_API_CALL
196clEnqueueReleaseD3D10ObjectsKHR(
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
215typedef cl_int (CL_API_CALL *
216clGetSupportedD3D10TextureFormatsINTEL_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
226extern CL_API_ENTRY cl_int CL_API_CALL
227clGetSupportedD3D10TextureFormatsINTEL(
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 Barbier6ff3b192017-09-04 18:44:23 +0100236
237#ifdef __cplusplus
238}
239#endif
240
Viet-Hoa Do633ebd12023-08-11 12:27:59 +0100241#endif /* OPENCL_CL_D3D10_H_ */