cl_d3d11.h revision 848b8605
1848b8605Smrg/**********************************************************************************
2848b8605Smrg * Copyright (c) 2008-2012 The Khronos Group Inc.
3848b8605Smrg *
4848b8605Smrg * Permission is hereby granted, free of charge, to any person obtaining a
5848b8605Smrg * copy of this software and/or associated documentation files (the
6848b8605Smrg * "Materials"), to deal in the Materials without restriction, including
7848b8605Smrg * without limitation the rights to use, copy, modify, merge, publish,
8848b8605Smrg * distribute, sublicense, and/or sell copies of the Materials, and to
9848b8605Smrg * permit persons to whom the Materials are furnished to do so, subject to
10848b8605Smrg * the following conditions:
11848b8605Smrg *
12848b8605Smrg * The above copyright notice and this permission notice shall be included
13848b8605Smrg * in all copies or substantial portions of the Materials.
14848b8605Smrg *
15848b8605Smrg * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16848b8605Smrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17848b8605Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18848b8605Smrg * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19848b8605Smrg * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20848b8605Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21848b8605Smrg * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
22848b8605Smrg **********************************************************************************/
23848b8605Smrg
24848b8605Smrg/* $Revision: 1.1.1.1 $ on $Date: 2019/03/08 10:19:24 $ */
25848b8605Smrg
26848b8605Smrg#ifndef __OPENCL_CL_D3D11_H
27848b8605Smrg#define __OPENCL_CL_D3D11_H
28848b8605Smrg
29848b8605Smrg#include <d3d11.h>
30848b8605Smrg#include <CL/cl.h>
31848b8605Smrg#include <CL/cl_platform.h>
32848b8605Smrg
33848b8605Smrg#ifdef __cplusplus
34848b8605Smrgextern "C" {
35848b8605Smrg#endif
36848b8605Smrg
37848b8605Smrg/******************************************************************************
38848b8605Smrg * cl_khr_d3d11_sharing                                                       */
39848b8605Smrg#define cl_khr_d3d11_sharing 1
40848b8605Smrg
41848b8605Smrgtypedef cl_uint cl_d3d11_device_source_khr;
42848b8605Smrgtypedef cl_uint cl_d3d11_device_set_khr;
43848b8605Smrg
44848b8605Smrg/******************************************************************************/
45848b8605Smrg
46848b8605Smrg/* Error Codes */
47848b8605Smrg#define CL_INVALID_D3D11_DEVICE_KHR                  -1006
48848b8605Smrg#define CL_INVALID_D3D11_RESOURCE_KHR                -1007
49848b8605Smrg#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR       -1008
50848b8605Smrg#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR           -1009
51848b8605Smrg
52848b8605Smrg/* cl_d3d11_device_source */
53848b8605Smrg#define CL_D3D11_DEVICE_KHR                          0x4019
54848b8605Smrg#define CL_D3D11_DXGI_ADAPTER_KHR                    0x401A
55848b8605Smrg
56848b8605Smrg/* cl_d3d11_device_set */
57848b8605Smrg#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR           0x401B
58848b8605Smrg#define CL_ALL_DEVICES_FOR_D3D11_KHR                 0x401C
59848b8605Smrg
60848b8605Smrg/* cl_context_info */
61848b8605Smrg#define CL_CONTEXT_D3D11_DEVICE_KHR                  0x401D
62848b8605Smrg#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
63848b8605Smrg
64848b8605Smrg/* cl_mem_info */
65848b8605Smrg#define CL_MEM_D3D11_RESOURCE_KHR                    0x401E
66848b8605Smrg
67848b8605Smrg/* cl_image_info */
68848b8605Smrg#define CL_IMAGE_D3D11_SUBRESOURCE_KHR               0x401F
69848b8605Smrg
70848b8605Smrg/* cl_command_type */
71848b8605Smrg#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR         0x4020
72848b8605Smrg#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR         0x4021
73848b8605Smrg
74848b8605Smrg/******************************************************************************/
75848b8605Smrg
76848b8605Smrgtypedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
77848b8605Smrg    cl_platform_id             platform,
78848b8605Smrg    cl_d3d11_device_source_khr d3d_device_source,
79848b8605Smrg    void *                     d3d_object,
80848b8605Smrg    cl_d3d11_device_set_khr    d3d_device_set,
81848b8605Smrg    cl_uint                    num_entries,
82848b8605Smrg    cl_device_id *             devices,
83848b8605Smrg    cl_uint *                  num_devices) CL_API_SUFFIX__VERSION_1_2;
84848b8605Smrg
85848b8605Smrgtypedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)(
86848b8605Smrg    cl_context     context,
87848b8605Smrg    cl_mem_flags   flags,
88848b8605Smrg    ID3D11Buffer * resource,
89848b8605Smrg    cl_int *       errcode_ret) CL_API_SUFFIX__VERSION_1_2;
90848b8605Smrg
91848b8605Smrgtypedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)(
92848b8605Smrg    cl_context        context,
93848b8605Smrg    cl_mem_flags      flags,
94848b8605Smrg    ID3D11Texture2D * resource,
95848b8605Smrg    UINT              subresource,
96848b8605Smrg    cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_2;
97848b8605Smrg
98848b8605Smrgtypedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)(
99848b8605Smrg    cl_context        context,
100848b8605Smrg    cl_mem_flags      flags,
101848b8605Smrg    ID3D11Texture3D * resource,
102848b8605Smrg    UINT              subresource,
103848b8605Smrg    cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_2;
104848b8605Smrg
105848b8605Smrgtypedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)(
106848b8605Smrg    cl_command_queue command_queue,
107848b8605Smrg    cl_uint          num_objects,
108848b8605Smrg    const cl_mem *   mem_objects,
109848b8605Smrg    cl_uint          num_events_in_wait_list,
110848b8605Smrg    const cl_event * event_wait_list,
111848b8605Smrg    cl_event *       event) CL_API_SUFFIX__VERSION_1_2;
112848b8605Smrg
113848b8605Smrgtypedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)(
114848b8605Smrg    cl_command_queue command_queue,
115848b8605Smrg    cl_uint          num_objects,
116848b8605Smrg    const cl_mem *   mem_objects,
117848b8605Smrg    cl_uint          num_events_in_wait_list,
118848b8605Smrg    const cl_event * event_wait_list,
119848b8605Smrg    cl_event *       event) CL_API_SUFFIX__VERSION_1_2;
120848b8605Smrg
121848b8605Smrg#ifdef __cplusplus
122848b8605Smrg}
123848b8605Smrg#endif
124848b8605Smrg
125848b8605Smrg#endif  /* __OPENCL_CL_D3D11_H */
126848b8605Smrg
127