| 1 |
/* |
| 2 |
* Copyright (C) 2018-2023 Intel Corporation |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: MIT |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
#pragma once |
| 9 |
|
| 10 |
#if __clang__ |
| 11 |
#pragma clang diagnostic push |
| 12 |
#pragma clang diagnostic ignored "-Wignored-pragma-intrinsic" |
| 13 |
#pragma clang diagnostic ignored "-Wpragma-pack" |
| 14 |
#pragma clang diagnostic ignored "-Wignored-attributes" |
| 15 |
#pragma clang diagnostic ignored "-Wmacro-redefined" |
| 16 |
#pragma clang diagnostic ignored "-Wcomment" |
| 17 |
#endif |
| 18 |
#include <d3d10_1.h> |
| 19 |
|
| 20 |
#include "CL/cl.h" |
| 21 |
#include "CL/cl_d3d10.h" |
| 22 |
#include "CL/cl_d3d11.h" |
| 23 |
#include "CL/cl_dx9_media_sharing.h" |
| 24 |
#define CL_DX9_MEDIA_SHARING_INTEL_EXT |
| 25 |
#include "CL/cl_dx9_media_sharing.h" |
| 26 |
#if __clang__ |
| 27 |
#pragma clang diagnostic pop |
| 28 |
#endif |
| 29 |
|
| 30 |
extern CL_API_ENTRY cl_int CL_API_CALL clGetDeviceIDsFromDX9INTEL( |
| 31 |
cl_platform_id platform, |
| 32 |
cl_dx9_device_source_intel dx9DeviceSource, |
| 33 |
void *dx9Object, |
| 34 |
cl_dx9_device_set_intel dx9DeviceSet, |
| 35 |
cl_uint numEntries, |
| 36 |
cl_device_id *devices, |
| 37 |
cl_uint *numDevices); |
| 38 |
|
| 39 |
extern CL_API_ENTRY cl_mem CL_API_CALL clCreateFromDX9MediaSurfaceINTEL( |
| 40 |
cl_context context, |
| 41 |
cl_mem_flags flags, |
| 42 |
IDirect3DSurface9 *resource, |
| 43 |
HANDLE sharedHandle, |
| 44 |
UINT plane, |
| 45 |
cl_int *errcodeRet); |
| 46 |
|
| 47 |
extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueAcquireDX9ObjectsINTEL( |
| 48 |
cl_command_queue commandQueue, |
| 49 |
cl_uint numObjects, |
| 50 |
const cl_mem *memObjects, |
| 51 |
cl_uint numEventsInWaitList, |
| 52 |
const cl_event *eventWaitList, |
| 53 |
cl_event *event); |
| 54 |
|
| 55 |
extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueReleaseDX9ObjectsINTEL( |
| 56 |
cl_command_queue commandQueue, |
| 57 |
cl_uint numObjects, |
| 58 |
cl_mem *memObjects, |
| 59 |
cl_uint numEventsInWaitList, |
| 60 |
const cl_event *eventWaitList, |
| 61 |
cl_event *event); |
| 62 |
|
| 63 |
extern CL_API_ENTRY cl_int CL_API_CALL clGetDeviceIDsFromDX9MediaAdapterKHR( |
| 64 |
cl_platform_id platform, |
| 65 |
cl_uint numMediaAdapters, |
| 66 |
cl_dx9_media_adapter_type_khr *mediaAdapterType, |
| 67 |
void *mediaAdapters, |
| 68 |
cl_dx9_media_adapter_set_khr mediaAdapterSet, |
| 69 |
cl_uint numEntries, |
| 70 |
cl_device_id *devices, |
| 71 |
cl_uint *numDevices) CL_API_SUFFIX__VERSION_1_2; |
| 72 |
|
| 73 |
extern CL_API_ENTRY cl_mem CL_API_CALL clCreateFromDX9MediaSurfaceKHR( |
| 74 |
cl_context context, |
| 75 |
cl_mem_flags flags, |
| 76 |
cl_dx9_media_adapter_type_khr adapterType, |
| 77 |
void *surfaceInfo, |
| 78 |
cl_uint plane, |
| 79 |
cl_int *errcodeRet) CL_API_SUFFIX__VERSION_1_2; |
| 80 |
|
| 81 |
extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueAcquireDX9MediaSurfacesKHR( |
| 82 |
cl_command_queue commandQueue, |
| 83 |
cl_uint numObjects, |
| 84 |
const cl_mem *memObjects, |
| 85 |
cl_uint numEventsInWaitList, |
| 86 |
const cl_event *eventWaitList, |
| 87 |
cl_event *event) CL_API_SUFFIX__VERSION_1_2; |
| 88 |
|
| 89 |
extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueReleaseDX9MediaSurfacesKHR( |
| 90 |
cl_command_queue commandQueue, |
| 91 |
cl_uint numObjects, |
| 92 |
const cl_mem *memObjects, |
| 93 |
cl_uint numEventsInWaitList, |
| 94 |
const cl_event *eventWaitList, |
| 95 |
cl_event *event) CL_API_SUFFIX__VERSION_1_2; |
| 96 |
|
| 97 |
extern CL_API_ENTRY cl_int CL_API_CALL |
| 98 |
clGetDeviceIDsFromD3D10KHR( |
| 99 |
cl_platform_id platform, |
| 100 |
cl_d3d10_device_source_khr d3dDeviceSource, |
| 101 |
void *d3dObject, |
| 102 |
cl_d3d10_device_set_khr d3dDeviceSet, |
| 103 |
cl_uint numEntries, |
| 104 |
cl_device_id *devices, |
| 105 |
cl_uint *numDevices) CL_API_SUFFIX__VERSION_1_0; |
| 106 |
|
| 107 |
extern CL_API_ENTRY cl_mem CL_API_CALL |
| 108 |
clCreateFromD3D10BufferKHR( |
| 109 |
cl_context context, |
| 110 |
cl_mem_flags flags, |
| 111 |
ID3D10Buffer *resource, |
| 112 |
cl_int *errcodeRet) CL_API_SUFFIX__VERSION_1_0; |
| 113 |
|
| 114 |
extern CL_API_ENTRY cl_mem CL_API_CALL |
| 115 |
clCreateFromD3D10Texture2DKHR( |
| 116 |
cl_context context, |
| 117 |
cl_mem_flags flags, |
| 118 |
ID3D10Texture2D *resource, |
| 119 |
UINT subresource, |
| 120 |
cl_int *errcodeRet) CL_API_SUFFIX__VERSION_1_0; |
| 121 |
|
| 122 |
extern CL_API_ENTRY cl_mem CL_API_CALL |
| 123 |
clCreateFromD3D10Texture3DKHR( |
| 124 |
cl_context context, |
| 125 |
cl_mem_flags flags, |
| 126 |
ID3D10Texture3D *resource, |
| 127 |
UINT subresource, |
| 128 |
cl_int *errcodeRet) CL_API_SUFFIX__VERSION_1_0; |
| 129 |
|
| 130 |
extern CL_API_ENTRY cl_int CL_API_CALL |
| 131 |
clEnqueueAcquireD3D10ObjectsKHR( |
| 132 |
cl_command_queue commandQueue, |
| 133 |
cl_uint numObjects, |
| 134 |
const cl_mem *memObjects, |
| 135 |
cl_uint numEventsInWaitList, |
| 136 |
const cl_event *eventWaitList, |
| 137 |
cl_event *event) CL_API_SUFFIX__VERSION_1_0; |
| 138 |
|
| 139 |
extern CL_API_ENTRY cl_int CL_API_CALL |
| 140 |
clEnqueueReleaseD3D10ObjectsKHR( |
| 141 |
cl_command_queue commandQueue, |
| 142 |
cl_uint numObjects, |
| 143 |
const cl_mem *memObjects, |
| 144 |
cl_uint numEventsInWaitList, |
| 145 |
const cl_event *eventWaitList, |
| 146 |
cl_event *event) CL_API_SUFFIX__VERSION_1_0; |
| 147 |
|
| 148 |
extern CL_API_ENTRY cl_int CL_API_CALL clGetDeviceIDsFromD3D11KHR( |
| 149 |
cl_platform_id platform, |
| 150 |
cl_d3d11_device_source_khr d3dDeviceSource, |
| 151 |
void *d3dObject, |
| 152 |
cl_d3d11_device_set_khr d3dDeviceSet, |
| 153 |
cl_uint numEntries, |
| 154 |
cl_device_id *devices, |
| 155 |
cl_uint *numDevices) CL_API_SUFFIX__VERSION_1_2; |
| 156 |
|
| 157 |
extern CL_API_ENTRY cl_mem CL_API_CALL clCreateFromD3D11BufferKHR( |
| 158 |
cl_context context, |
| 159 |
cl_mem_flags flags, |
| 160 |
ID3D11Buffer *resource, |
| 161 |
cl_int *errcodeRet) CL_API_SUFFIX__VERSION_1_2; |
| 162 |
|
| 163 |
extern CL_API_ENTRY cl_mem CL_API_CALL clCreateFromD3D11Texture2DKHR( |
| 164 |
cl_context context, |
| 165 |
cl_mem_flags flags, |
| 166 |
ID3D11Texture2D *resource, |
| 167 |
UINT subresource, |
| 168 |
cl_int *errcodeRet) CL_API_SUFFIX__VERSION_1_2; |
| 169 |
|
| 170 |
extern CL_API_ENTRY cl_mem CL_API_CALL clCreateFromD3D11Texture3DKHR( |
| 171 |
cl_context context, |
| 172 |
cl_mem_flags flags, |
| 173 |
ID3D11Texture3D *resource, |
| 174 |
UINT subresource, |
| 175 |
cl_int *errcodeRet) CL_API_SUFFIX__VERSION_1_2; |
| 176 |
|
| 177 |
extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueAcquireD3D11ObjectsKHR( |
| 178 |
cl_command_queue commandQueue, |
| 179 |
cl_uint numObjects, |
| 180 |
const cl_mem *memObjects, |
| 181 |
cl_uint numEventsInWaitList, |
| 182 |
const cl_event *eventWaitList, |
| 183 |
cl_event *event) CL_API_SUFFIX__VERSION_1_2; |
| 184 |
|
| 185 |
extern CL_API_ENTRY cl_int CL_API_CALL clEnqueueReleaseD3D11ObjectsKHR( |
| 186 |
cl_command_queue commandQueue, |
| 187 |
cl_uint numObjects, |
| 188 |
const cl_mem *memObjects, |
| 189 |
cl_uint numEventsInWaitList, |
| 190 |
const cl_event *eventWaitList, |
| 191 |
cl_event *event) CL_API_SUFFIX__VERSION_1_2; |
| 192 |
|
| 193 |
extern CL_API_ENTRY cl_int CL_API_CALL clGetSupportedDX9MediaSurfaceFormatsINTEL( |
| 194 |
cl_context context, |
| 195 |
cl_mem_flags flags, |
| 196 |
cl_mem_object_type imageType, |
| 197 |
cl_uint plane, |
| 198 |
cl_uint numEntries, |
| 199 |
D3DFORMAT *dx9Formats, |
| 200 |
cl_uint *numImageFormats) CL_API_SUFFIX__VERSION_1_2; |
| 201 |
|
| 202 |
extern CL_API_ENTRY cl_int CL_API_CALL clGetSupportedD3D10TextureFormatsINTEL( |
| 203 |
cl_context context, |
| 204 |
cl_mem_flags flags, |
| 205 |
cl_mem_object_type imageType, |
| 206 |
cl_uint numEntries, |
| 207 |
DXGI_FORMAT *dx10Formats, |
| 208 |
cl_uint *numImageFormats) CL_API_SUFFIX__VERSION_1_2; |
| 209 |
|
| 210 |
extern CL_API_ENTRY cl_int CL_API_CALL clGetSupportedD3D11TextureFormatsINTEL( |
| 211 |
cl_context context, |
| 212 |
cl_mem_flags flags, |
| 213 |
cl_mem_object_type imageType, |
| 214 |
cl_uint plane, |
| 215 |
cl_uint numEntries, |
| 216 |
DXGI_FORMAT *dx11Formats, |
| 217 |
cl_uint *numImageFormats) CL_API_SUFFIX__VERSION_1_2; |