xref: /OK3568_Linux_fs/external/libmali/include/CL/cl_d3d10.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /**********************************************************************************
2*4882a593Smuzhiyun  * Copyright (c) 2008-2015 The Khronos Group Inc.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining a
5*4882a593Smuzhiyun  * copy of this software and/or associated documentation files (the
6*4882a593Smuzhiyun  * "Materials"), to deal in the Materials without restriction, including
7*4882a593Smuzhiyun  * without limitation the rights to use, copy, modify, merge, publish,
8*4882a593Smuzhiyun  * distribute, sublicense, and/or sell copies of the Materials, and to
9*4882a593Smuzhiyun  * permit persons to whom the Materials are furnished to do so, subject to
10*4882a593Smuzhiyun  * the following conditions:
11*4882a593Smuzhiyun  *
12*4882a593Smuzhiyun  * The above copyright notice and this permission notice shall be included
13*4882a593Smuzhiyun  * in all copies or substantial portions of the Materials.
14*4882a593Smuzhiyun  *
15*4882a593Smuzhiyun  * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16*4882a593Smuzhiyun  * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17*4882a593Smuzhiyun  * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18*4882a593Smuzhiyun  *    https://www.khronos.org/registry/
19*4882a593Smuzhiyun  *
20*4882a593Smuzhiyun  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21*4882a593Smuzhiyun  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22*4882a593Smuzhiyun  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23*4882a593Smuzhiyun  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24*4882a593Smuzhiyun  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25*4882a593Smuzhiyun  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26*4882a593Smuzhiyun  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27*4882a593Smuzhiyun  **********************************************************************************/
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun /* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun #ifndef __OPENCL_CL_D3D10_H
32*4882a593Smuzhiyun #define __OPENCL_CL_D3D10_H
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun #include <d3d10.h>
35*4882a593Smuzhiyun #include <CL/cl.h>
36*4882a593Smuzhiyun #include <CL/cl_platform.h>
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun #ifdef __cplusplus
39*4882a593Smuzhiyun extern "C" {
40*4882a593Smuzhiyun #endif
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun /******************************************************************************
43*4882a593Smuzhiyun  * cl_khr_d3d10_sharing                                                       */
44*4882a593Smuzhiyun #define cl_khr_d3d10_sharing 1
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun typedef cl_uint cl_d3d10_device_source_khr;
47*4882a593Smuzhiyun typedef cl_uint cl_d3d10_device_set_khr;
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun /******************************************************************************/
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun /* Error Codes */
52*4882a593Smuzhiyun #define CL_INVALID_D3D10_DEVICE_KHR                  -1002
53*4882a593Smuzhiyun #define CL_INVALID_D3D10_RESOURCE_KHR                -1003
54*4882a593Smuzhiyun #define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR       -1004
55*4882a593Smuzhiyun #define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR           -1005
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun /* cl_d3d10_device_source_nv */
58*4882a593Smuzhiyun #define CL_D3D10_DEVICE_KHR                          0x4010
59*4882a593Smuzhiyun #define CL_D3D10_DXGI_ADAPTER_KHR                    0x4011
60*4882a593Smuzhiyun 
61*4882a593Smuzhiyun /* cl_d3d10_device_set_nv */
62*4882a593Smuzhiyun #define CL_PREFERRED_DEVICES_FOR_D3D10_KHR           0x4012
63*4882a593Smuzhiyun #define CL_ALL_DEVICES_FOR_D3D10_KHR                 0x4013
64*4882a593Smuzhiyun 
65*4882a593Smuzhiyun /* cl_context_info */
66*4882a593Smuzhiyun #define CL_CONTEXT_D3D10_DEVICE_KHR                  0x4014
67*4882a593Smuzhiyun #define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
68*4882a593Smuzhiyun 
69*4882a593Smuzhiyun /* cl_mem_info */
70*4882a593Smuzhiyun #define CL_MEM_D3D10_RESOURCE_KHR                    0x4015
71*4882a593Smuzhiyun 
72*4882a593Smuzhiyun /* cl_image_info */
73*4882a593Smuzhiyun #define CL_IMAGE_D3D10_SUBRESOURCE_KHR               0x4016
74*4882a593Smuzhiyun 
75*4882a593Smuzhiyun /* cl_command_type */
76*4882a593Smuzhiyun #define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR         0x4017
77*4882a593Smuzhiyun #define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR         0x4018
78*4882a593Smuzhiyun 
79*4882a593Smuzhiyun /******************************************************************************/
80*4882a593Smuzhiyun 
81*4882a593Smuzhiyun typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
82*4882a593Smuzhiyun     cl_platform_id             platform,
83*4882a593Smuzhiyun     cl_d3d10_device_source_khr d3d_device_source,
84*4882a593Smuzhiyun     void *                     d3d_object,
85*4882a593Smuzhiyun     cl_d3d10_device_set_khr    d3d_device_set,
86*4882a593Smuzhiyun     cl_uint                    num_entries,
87*4882a593Smuzhiyun     cl_device_id *             devices,
88*4882a593Smuzhiyun     cl_uint *                  num_devices) CL_API_SUFFIX__VERSION_1_0;
89*4882a593Smuzhiyun 
90*4882a593Smuzhiyun typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
91*4882a593Smuzhiyun     cl_context     context,
92*4882a593Smuzhiyun     cl_mem_flags   flags,
93*4882a593Smuzhiyun     ID3D10Buffer * resource,
94*4882a593Smuzhiyun     cl_int *       errcode_ret) CL_API_SUFFIX__VERSION_1_0;
95*4882a593Smuzhiyun 
96*4882a593Smuzhiyun typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
97*4882a593Smuzhiyun     cl_context        context,
98*4882a593Smuzhiyun     cl_mem_flags      flags,
99*4882a593Smuzhiyun     ID3D10Texture2D * resource,
100*4882a593Smuzhiyun     UINT              subresource,
101*4882a593Smuzhiyun     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
102*4882a593Smuzhiyun 
103*4882a593Smuzhiyun typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
104*4882a593Smuzhiyun     cl_context        context,
105*4882a593Smuzhiyun     cl_mem_flags      flags,
106*4882a593Smuzhiyun     ID3D10Texture3D * resource,
107*4882a593Smuzhiyun     UINT              subresource,
108*4882a593Smuzhiyun     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
109*4882a593Smuzhiyun 
110*4882a593Smuzhiyun typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
111*4882a593Smuzhiyun     cl_command_queue command_queue,
112*4882a593Smuzhiyun     cl_uint          num_objects,
113*4882a593Smuzhiyun     const cl_mem *   mem_objects,
114*4882a593Smuzhiyun     cl_uint          num_events_in_wait_list,
115*4882a593Smuzhiyun     const cl_event * event_wait_list,
116*4882a593Smuzhiyun     cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
117*4882a593Smuzhiyun 
118*4882a593Smuzhiyun typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
119*4882a593Smuzhiyun     cl_command_queue command_queue,
120*4882a593Smuzhiyun     cl_uint          num_objects,
121*4882a593Smuzhiyun     const cl_mem *   mem_objects,
122*4882a593Smuzhiyun     cl_uint          num_events_in_wait_list,
123*4882a593Smuzhiyun     const cl_event * event_wait_list,
124*4882a593Smuzhiyun     cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
125*4882a593Smuzhiyun 
126*4882a593Smuzhiyun #ifdef __cplusplus
127*4882a593Smuzhiyun }
128*4882a593Smuzhiyun #endif
129*4882a593Smuzhiyun 
130*4882a593Smuzhiyun #endif  /* __OPENCL_CL_D3D10_H */
131*4882a593Smuzhiyun 
132