1848b8605Smrg/**********************************************************************************
2b8e80941Smrg * Copyright (c) 2008-2015 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 *
15b8e80941Smrg * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16b8e80941Smrg * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17b8e80941Smrg * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18b8e80941Smrg *    https://www.khronos.org/registry/
19b8e80941Smrg *
20848b8605Smrg * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21848b8605Smrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22848b8605Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23848b8605Smrg * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24848b8605Smrg * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25848b8605Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26848b8605Smrg * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27848b8605Smrg **********************************************************************************/
28848b8605Smrg
29b8e80941Smrg/* $Revision: 1.1.1.2 $ on $Date: 2021/07/11 20:36:21 $ */
30848b8605Smrg
31848b8605Smrg#ifndef __OPENCL_CL_D3D11_H
32848b8605Smrg#define __OPENCL_CL_D3D11_H
33848b8605Smrg
34848b8605Smrg#include <d3d11.h>
35848b8605Smrg#include <CL/cl.h>
36848b8605Smrg#include <CL/cl_platform.h>
37848b8605Smrg
38848b8605Smrg#ifdef __cplusplus
39848b8605Smrgextern "C" {
40848b8605Smrg#endif
41848b8605Smrg
42848b8605Smrg/******************************************************************************
43848b8605Smrg * cl_khr_d3d11_sharing                                                       */
44848b8605Smrg#define cl_khr_d3d11_sharing 1
45848b8605Smrg
46848b8605Smrgtypedef cl_uint cl_d3d11_device_source_khr;
47848b8605Smrgtypedef cl_uint cl_d3d11_device_set_khr;
48848b8605Smrg
49848b8605Smrg/******************************************************************************/
50848b8605Smrg
51848b8605Smrg/* Error Codes */
52848b8605Smrg#define CL_INVALID_D3D11_DEVICE_KHR                  -1006
53848b8605Smrg#define CL_INVALID_D3D11_RESOURCE_KHR                -1007
54848b8605Smrg#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR       -1008
55848b8605Smrg#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR           -1009
56848b8605Smrg
57848b8605Smrg/* cl_d3d11_device_source */
58848b8605Smrg#define CL_D3D11_DEVICE_KHR                          0x4019
59848b8605Smrg#define CL_D3D11_DXGI_ADAPTER_KHR                    0x401A
60848b8605Smrg
61848b8605Smrg/* cl_d3d11_device_set */
62848b8605Smrg#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR           0x401B
63848b8605Smrg#define CL_ALL_DEVICES_FOR_D3D11_KHR                 0x401C
64848b8605Smrg
65848b8605Smrg/* cl_context_info */
66848b8605Smrg#define CL_CONTEXT_D3D11_DEVICE_KHR                  0x401D
67848b8605Smrg#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
68848b8605Smrg
69848b8605Smrg/* cl_mem_info */
70848b8605Smrg#define CL_MEM_D3D11_RESOURCE_KHR                    0x401E
71848b8605Smrg
72848b8605Smrg/* cl_image_info */
73848b8605Smrg#define CL_IMAGE_D3D11_SUBRESOURCE_KHR               0x401F
74848b8605Smrg
75848b8605Smrg/* cl_command_type */
76848b8605Smrg#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR         0x4020
77848b8605Smrg#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR         0x4021
78848b8605Smrg
79848b8605Smrg/******************************************************************************/
80848b8605Smrg
81848b8605Smrgtypedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
82848b8605Smrg    cl_platform_id             platform,
83848b8605Smrg    cl_d3d11_device_source_khr d3d_device_source,
84848b8605Smrg    void *                     d3d_object,
85848b8605Smrg    cl_d3d11_device_set_khr    d3d_device_set,
86848b8605Smrg    cl_uint                    num_entries,
87848b8605Smrg    cl_device_id *             devices,
88848b8605Smrg    cl_uint *                  num_devices) CL_API_SUFFIX__VERSION_1_2;
89848b8605Smrg
90848b8605Smrgtypedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)(
91848b8605Smrg    cl_context     context,
92848b8605Smrg    cl_mem_flags   flags,
93848b8605Smrg    ID3D11Buffer * resource,
94848b8605Smrg    cl_int *       errcode_ret) CL_API_SUFFIX__VERSION_1_2;
95848b8605Smrg
96848b8605Smrgtypedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)(
97848b8605Smrg    cl_context        context,
98848b8605Smrg    cl_mem_flags      flags,
99848b8605Smrg    ID3D11Texture2D * resource,
100848b8605Smrg    UINT              subresource,
101848b8605Smrg    cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_2;
102848b8605Smrg
103848b8605Smrgtypedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)(
104848b8605Smrg    cl_context        context,
105848b8605Smrg    cl_mem_flags      flags,
106848b8605Smrg    ID3D11Texture3D * resource,
107848b8605Smrg    UINT              subresource,
108848b8605Smrg    cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_2;
109848b8605Smrg
110848b8605Smrgtypedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)(
111848b8605Smrg    cl_command_queue command_queue,
112848b8605Smrg    cl_uint          num_objects,
113848b8605Smrg    const cl_mem *   mem_objects,
114848b8605Smrg    cl_uint          num_events_in_wait_list,
115848b8605Smrg    const cl_event * event_wait_list,
116848b8605Smrg    cl_event *       event) CL_API_SUFFIX__VERSION_1_2;
117848b8605Smrg
118848b8605Smrgtypedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)(
119848b8605Smrg    cl_command_queue command_queue,
120848b8605Smrg    cl_uint          num_objects,
121848b8605Smrg    const cl_mem *   mem_objects,
122848b8605Smrg    cl_uint          num_events_in_wait_list,
123848b8605Smrg    const cl_event * event_wait_list,
124848b8605Smrg    cl_event *       event) CL_API_SUFFIX__VERSION_1_2;
125848b8605Smrg
126848b8605Smrg#ifdef __cplusplus
127848b8605Smrg}
128848b8605Smrg#endif
129848b8605Smrg
130848b8605Smrg#endif  /* __OPENCL_CL_D3D11_H */
131848b8605Smrg
132