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