blob: 2b80d90cb55684f05cf081b400c5e3a9c6f6f18a [file] [log] [blame]
Sheri Zhang79cb9452021-09-07 14:51:49 +01001/*******************************************************************************
2 * Copyright (c) 2008-2020 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
17#ifndef __OPENCL_CL_D3D10_H
18#define __OPENCL_CL_D3D10_H
19
Sheri Zhang79cb9452021-09-07 14:51:49 +010020#if defined(_MSC_VER)
21#if _MSC_VER >=1500
22#pragma warning( push )
23#pragma warning( disable : 4201 )
24#endif
25#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010026#include <d3d10.h>
Sheri Zhang79cb9452021-09-07 14:51:49 +010027#if defined(_MSC_VER)
28#if _MSC_VER >=1500
29#pragma warning( pop )
30#endif
31#endif
Anthony Barbier6ff3b192017-09-04 18:44:23 +010032#include <CL/cl.h>
33#include <CL/cl_platform.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39/******************************************************************************
40 * cl_khr_d3d10_sharing */
41#define cl_khr_d3d10_sharing 1
42
43typedef cl_uint cl_d3d10_device_source_khr;
44typedef cl_uint cl_d3d10_device_set_khr;
45
46/******************************************************************************/
47
Pablo Telloe86a09f2018-01-11 15:44:48 +000048/* Error Codes */
Anthony Barbier6ff3b192017-09-04 18:44:23 +010049#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 Telloe86a09f2018-01-11 15:44:48 +000054/* cl_d3d10_device_source_nv */
Anthony Barbier6ff3b192017-09-04 18:44:23 +010055#define CL_D3D10_DEVICE_KHR 0x4010
56#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011
57
Pablo Telloe86a09f2018-01-11 15:44:48 +000058/* cl_d3d10_device_set_nv */
Anthony Barbier6ff3b192017-09-04 18:44:23 +010059#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012
60#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013
61
Pablo Telloe86a09f2018-01-11 15:44:48 +000062/* cl_context_info */
Anthony Barbier6ff3b192017-09-04 18:44:23 +010063#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014
64#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
65
Pablo Telloe86a09f2018-01-11 15:44:48 +000066/* cl_mem_info */
Anthony Barbier6ff3b192017-09-04 18:44:23 +010067#define CL_MEM_D3D10_RESOURCE_KHR 0x4015
68
Pablo Telloe86a09f2018-01-11 15:44:48 +000069/* cl_image_info */
Anthony Barbier6ff3b192017-09-04 18:44:23 +010070#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016
71
Pablo Telloe86a09f2018-01-11 15:44:48 +000072/* cl_command_type */
Anthony Barbier6ff3b192017-09-04 18:44:23 +010073#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017
74#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
75
76/******************************************************************************/
77
78typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
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
87typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
88 cl_context context,
89 cl_mem_flags flags,
90 ID3D10Buffer * resource,
91 cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
92
93typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
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
100typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
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
107typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
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
115typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
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 Telloe86a09f2018-01-11 15:44:48 +0000127#endif /* __OPENCL_CL_D3D10_H */
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100128