Path: blob/21.2-virgl/include/CL/cl_dx9_media_sharing.h
4547 views
/**********************************************************************************1* Copyright (c) 2008-2015 The Khronos Group Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and/or associated documentation files (the5* "Materials"), to deal in the Materials without restriction, including6* without limitation the rights to use, copy, modify, merge, publish,7* distribute, sublicense, and/or sell copies of the Materials, and to8* permit persons to whom the Materials are furnished to do so, subject to9* the following conditions:10*11* The above copyright notice and this permission notice shall be included12* in all copies or substantial portions of the Materials.13*14* MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS15* KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS16* SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT17* https://www.khronos.org/registry/18*19* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,20* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF21* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.22* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY23* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,24* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE25* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.26**********************************************************************************/2728/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */2930#ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H31#define __OPENCL_CL_DX9_MEDIA_SHARING_H3233#include <CL/cl.h>34#include <CL/cl_platform.h>3536#ifdef __cplusplus37extern "C" {38#endif3940/******************************************************************************/41/* cl_khr_dx9_media_sharing */42#define cl_khr_dx9_media_sharing 14344typedef cl_uint cl_dx9_media_adapter_type_khr;45typedef cl_uint cl_dx9_media_adapter_set_khr;4647#if defined(_WIN32)48#include <d3d9.h>49typedef struct _cl_dx9_surface_info_khr50{51IDirect3DSurface9 *resource;52HANDLE shared_handle;53} cl_dx9_surface_info_khr;54#endif555657/******************************************************************************/5859/* Error Codes */60#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -101061#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -101162#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -101263#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -10136465/* cl_media_adapter_type_khr */66#define CL_ADAPTER_D3D9_KHR 0x202067#define CL_ADAPTER_D3D9EX_KHR 0x202168#define CL_ADAPTER_DXVA_KHR 0x20226970/* cl_media_adapter_set_khr */71#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x202372#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x20247374/* cl_context_info */75#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x202576#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x202677#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x20277879/* cl_mem_info */80#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x202881#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x20298283/* cl_image_info */84#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A8586/* cl_command_type */87#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B88#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C8990/******************************************************************************/9192typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)(93cl_platform_id platform,94cl_uint num_media_adapters,95cl_dx9_media_adapter_type_khr * media_adapter_type,96void * media_adapters,97cl_dx9_media_adapter_set_khr media_adapter_set,98cl_uint num_entries,99cl_device_id * devices,100cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;101102typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)(103cl_context context,104cl_mem_flags flags,105cl_dx9_media_adapter_type_khr adapter_type,106void * surface_info,107cl_uint plane,108cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;109110typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)(111cl_command_queue command_queue,112cl_uint num_objects,113const cl_mem * mem_objects,114cl_uint num_events_in_wait_list,115const cl_event * event_wait_list,116cl_event * event) CL_API_SUFFIX__VERSION_1_2;117118typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)(119cl_command_queue command_queue,120cl_uint num_objects,121const cl_mem * mem_objects,122cl_uint num_events_in_wait_list,123const cl_event * event_wait_list,124cl_event * event) CL_API_SUFFIX__VERSION_1_2;125126#ifdef __cplusplus127}128#endif129130#endif /* __OPENCL_CL_DX9_MEDIA_SHARING_H */131132133134