1793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/**********************************************************************************
2793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Copyright (c) 2008-2012 The Khronos Group Inc.
3793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
4793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * Permission is hereby granted, free of charge, to any person obtaining a
5793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * copy of this software and/or associated documentation files (the
6793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * "Materials"), to deal in the Materials without restriction, including
7793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * without limitation the rights to use, copy, modify, merge, publish,
8793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * distribute, sublicense, and/or sell copies of the Materials, and to
9793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * permit persons to whom the Materials are furnished to do so, subject to
10793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * the following conditions:
11793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
12793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * The above copyright notice and this permission notice shall be included
13793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * in all copies or substantial portions of the Materials.
14793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler *
15793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
22793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler **********************************************************************************/
23793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
24793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */
25793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
26793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#ifndef __OPENCL_CL_D3D10_H
27793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define __OPENCL_CL_D3D10_H
28793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
29793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include <d3d10.h>
30793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include <CL/cl.h>
31793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#include <CL/cl_platform.h>
32793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
33793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#ifdef __cplusplus
34793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslerextern "C" {
35793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#endif
36793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
37793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/******************************************************************************
38793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler * cl_khr_d3d10_sharing                                                       */
39793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define cl_khr_d3d10_sharing 1
40793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
41793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertypedef cl_uint cl_d3d10_device_source_khr;
42793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertypedef cl_uint cl_d3d10_device_set_khr;
43793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
44793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/******************************************************************************/
45793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
46793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// Error Codes
47793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_INVALID_D3D10_DEVICE_KHR                  -1002
48793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_INVALID_D3D10_RESOURCE_KHR                -1003
49793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR       -1004
50793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR           -1005
51793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
52793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// cl_d3d10_device_source_nv
53793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_D3D10_DEVICE_KHR                          0x4010
54793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_D3D10_DXGI_ADAPTER_KHR                    0x4011
55793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
56793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// cl_d3d10_device_set_nv
57793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR           0x4012
58793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_ALL_DEVICES_FOR_D3D10_KHR                 0x4013
59793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
60793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// cl_context_info
61793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_CONTEXT_D3D10_DEVICE_KHR                  0x4014
62793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
63793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
64793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// cl_mem_info
65793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_MEM_D3D10_RESOURCE_KHR                    0x4015
66793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
67793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// cl_image_info
68793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_IMAGE_D3D10_SUBRESOURCE_KHR               0x4016
69793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
70793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler// cl_command_type
71793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR         0x4017
72793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR         0x4018
73793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
74793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler/******************************************************************************/
75793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
76793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertypedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
77793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_platform_id             platform,
78793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_d3d10_device_source_khr d3d_device_source,
79793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    void *                     d3d_object,
80793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_d3d10_device_set_khr    d3d_device_set,
81793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_uint                    num_entries,
82793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_device_id *             devices,
83793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_uint *                  num_devices) CL_API_SUFFIX__VERSION_1_0;
84793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
85793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertypedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
86793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_context     context,
87793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_mem_flags   flags,
88793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    ID3D10Buffer * resource,
89793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_int *       errcode_ret) CL_API_SUFFIX__VERSION_1_0;
90793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
91793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertypedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
92793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_context        context,
93793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_mem_flags      flags,
94793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    ID3D10Texture2D * resource,
95793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    UINT              subresource,
96793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
97793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
98793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertypedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
99793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_context        context,
100793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_mem_flags      flags,
101793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    ID3D10Texture3D * resource,
102793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    UINT              subresource,
103793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
104793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
105793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertypedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
106793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_command_queue command_queue,
107793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_uint          num_objects,
108793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    const cl_mem *   mem_objects,
109793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_uint          num_events_in_wait_list,
110793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    const cl_event * event_wait_list,
111793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
112793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
113793ee12c6df9cad3806238d32528c49a3ff9331dNoah Preslertypedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
114793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_command_queue command_queue,
115793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_uint          num_objects,
116793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    const cl_mem *   mem_objects,
117793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_uint          num_events_in_wait_list,
118793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    const cl_event * event_wait_list,
119793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler    cl_event *       event) CL_API_SUFFIX__VERSION_1_0;
120793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
121793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#ifdef __cplusplus
122793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler}
123793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#endif
124793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
125793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler#endif  // __OPENCL_CL_D3D10_H
126793ee12c6df9cad3806238d32528c49a3ff9331dNoah Presler
127