Commit 6623a70f by Jamie Madill Committed by Commit Bot

Stubs for OpenCL entry points.

Bug: angleproject:5653 Change-Id: I7ec9692a47be2556fef5bdd7630b422cc2d369b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2708343 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 4a782eaf
...@@ -54,6 +54,7 @@ if (angle_build_all) { ...@@ -54,6 +54,7 @@ if (angle_build_all) {
":translator_fuzzer", ":translator_fuzzer",
":xxhash_fuzzer", ":xxhash_fuzzer",
"$angle_root/samples:angle_samples", "$angle_root/samples:angle_samples",
"$angle_root/src/libOpenCL:angle_cl",
"$angle_root/src/tests:angle_tests", "$angle_root/src/tests:angle_tests",
] ]
} }
......
DisableFormat: true
This diff is collapsed. Click to expand it.
/*******************************************************************************
* Copyright (c) 2008-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#ifndef __OPENCL_CL_D3D10_H
#define __OPENCL_CL_D3D10_H
#if defined(_MSC_VER)
#if _MSC_VER >=1500
#pragma warning( push )
#pragma warning( disable : 4201 )
#endif
#endif
#include <d3d10.h>
#if defined(_MSC_VER)
#if _MSC_VER >=1500
#pragma warning( pop )
#endif
#endif
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* cl_khr_d3d10_sharing */
#define cl_khr_d3d10_sharing 1
typedef cl_uint cl_d3d10_device_source_khr;
typedef cl_uint cl_d3d10_device_set_khr;
/******************************************************************************/
/* Error Codes */
#define CL_INVALID_D3D10_DEVICE_KHR -1002
#define CL_INVALID_D3D10_RESOURCE_KHR -1003
#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004
#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005
/* cl_d3d10_device_source_nv */
#define CL_D3D10_DEVICE_KHR 0x4010
#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011
/* cl_d3d10_device_set_nv */
#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012
#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013
/* cl_context_info */
#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014
#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
/* cl_mem_info */
#define CL_MEM_D3D10_RESOURCE_KHR 0x4015
/* cl_image_info */
#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017
#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
cl_platform_id platform,
cl_d3d10_device_source_khr d3d_device_source,
void * d3d_object,
cl_d3d10_device_set_khr d3d_device_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Buffer * resource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture2D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture3D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_D3D10_H */
/*******************************************************************************
* Copyright (c) 2008-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#ifndef __OPENCL_CL_D3D11_H
#define __OPENCL_CL_D3D11_H
#if defined(_MSC_VER)
#if _MSC_VER >=1500
#pragma warning( push )
#pragma warning( disable : 4201 )
#endif
#endif
#include <d3d11.h>
#if defined(_MSC_VER)
#if _MSC_VER >=1500
#pragma warning( pop )
#endif
#endif
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
* cl_khr_d3d11_sharing */
#define cl_khr_d3d11_sharing 1
typedef cl_uint cl_d3d11_device_source_khr;
typedef cl_uint cl_d3d11_device_set_khr;
/******************************************************************************/
/* Error Codes */
#define CL_INVALID_D3D11_DEVICE_KHR -1006
#define CL_INVALID_D3D11_RESOURCE_KHR -1007
#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008
#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009
/* cl_d3d11_device_source */
#define CL_D3D11_DEVICE_KHR 0x4019
#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A
/* cl_d3d11_device_set */
#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B
#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C
/* cl_context_info */
#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D
#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
/* cl_mem_info */
#define CL_MEM_D3D11_RESOURCE_KHR 0x401E
/* cl_image_info */
#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020
#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
cl_platform_id platform,
cl_d3d11_device_source_khr d3d_device_source,
void * d3d_object,
cl_d3d11_device_set_khr d3d_device_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D11Buffer * resource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D11Texture2D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)(
cl_context context,
cl_mem_flags flags,
ID3D11Texture3D * resource,
UINT subresource,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_D3D11_H */
/*******************************************************************************
* Copyright (c) 2008-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H
#define __OPENCL_CL_DX9_MEDIA_SHARING_H
#include <CL/cl.h>
#include <CL/cl_platform.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************/
/* cl_khr_dx9_media_sharing */
#define cl_khr_dx9_media_sharing 1
typedef cl_uint cl_dx9_media_adapter_type_khr;
typedef cl_uint cl_dx9_media_adapter_set_khr;
#if defined(_WIN32)
#include <d3d9.h>
typedef struct _cl_dx9_surface_info_khr
{
IDirect3DSurface9 *resource;
HANDLE shared_handle;
} cl_dx9_surface_info_khr;
#endif
/******************************************************************************/
/* Error Codes */
#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010
#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011
#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012
#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013
/* cl_media_adapter_type_khr */
#define CL_ADAPTER_D3D9_KHR 0x2020
#define CL_ADAPTER_D3D9EX_KHR 0x2021
#define CL_ADAPTER_DXVA_KHR 0x2022
/* cl_media_adapter_set_khr */
#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023
#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024
/* cl_context_info */
#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025
#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026
#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027
/* cl_mem_info */
#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028
#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029
/* cl_image_info */
#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B
#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)(
cl_platform_id platform,
cl_uint num_media_adapters,
cl_dx9_media_adapter_type_khr * media_adapter_type,
void * media_adapters,
cl_dx9_media_adapter_set_khr media_adapter_set,
cl_uint num_entries,
cl_device_id * devices,
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)(
cl_context context,
cl_mem_flags flags,
cl_dx9_media_adapter_type_khr adapter_type,
void * surface_info,
cl_uint plane,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_2;
/***************************************
* cl_intel_dx9_media_sharing extension *
****************************************/
#define cl_intel_dx9_media_sharing 1
typedef cl_uint cl_dx9_device_source_intel;
typedef cl_uint cl_dx9_device_set_intel;
/* error codes */
#define CL_INVALID_DX9_DEVICE_INTEL -1010
#define CL_INVALID_DX9_RESOURCE_INTEL -1011
#define CL_DX9_RESOURCE_ALREADY_ACQUIRED_INTEL -1012
#define CL_DX9_RESOURCE_NOT_ACQUIRED_INTEL -1013
/* cl_dx9_device_source_intel */
#define CL_D3D9_DEVICE_INTEL 0x4022
#define CL_D3D9EX_DEVICE_INTEL 0x4070
#define CL_DXVA_DEVICE_INTEL 0x4071
/* cl_dx9_device_set_intel */
#define CL_PREFERRED_DEVICES_FOR_DX9_INTEL 0x4024
#define CL_ALL_DEVICES_FOR_DX9_INTEL 0x4025
/* cl_context_info */
#define CL_CONTEXT_D3D9_DEVICE_INTEL 0x4026
#define CL_CONTEXT_D3D9EX_DEVICE_INTEL 0x4072
#define CL_CONTEXT_DXVA_DEVICE_INTEL 0x4073
/* cl_mem_info */
#define CL_MEM_DX9_RESOURCE_INTEL 0x4027
#define CL_MEM_DX9_SHARED_HANDLE_INTEL 0x4074
/* cl_image_info */
#define CL_IMAGE_DX9_PLANE_INTEL 0x4075
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_DX9_OBJECTS_INTEL 0x402A
#define CL_COMMAND_RELEASE_DX9_OBJECTS_INTEL 0x402B
/******************************************************************************/
extern CL_API_ENTRY cl_int CL_API_CALL
clGetDeviceIDsFromDX9INTEL(
cl_platform_id platform,
cl_dx9_device_source_intel dx9_device_source,
void* dx9_object,
cl_dx9_device_set_intel dx9_device_set,
cl_uint num_entries,
cl_device_id* devices,
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int (CL_API_CALL* clGetDeviceIDsFromDX9INTEL_fn)(
cl_platform_id platform,
cl_dx9_device_source_intel dx9_device_source,
void* dx9_object,
cl_dx9_device_set_intel dx9_device_set,
cl_uint num_entries,
cl_device_id* devices,
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromDX9MediaSurfaceINTEL(
cl_context context,
cl_mem_flags flags,
IDirect3DSurface9* resource,
HANDLE sharedHandle,
UINT plane,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceINTEL_fn)(
cl_context context,
cl_mem_flags flags,
IDirect3DSurface9* resource,
HANDLE sharedHandle,
UINT plane,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueAcquireDX9ObjectsINTEL(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9ObjectsINTEL_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReleaseDX9ObjectsINTEL(
cl_command_queue command_queue,
cl_uint num_objects,
cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9ObjectsINTEL_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_1;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_DX9_MEDIA_SHARING_H */
/*******************************************************************************
* Copyright (c) 2008-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#include <CL/cl_dx9_media_sharing.h>
#pragma message("The Intel DX9 media sharing extensions have been moved into cl_dx9_media_sharing.h. Please include cl_dx9_media_sharing.h directly.")
/*******************************************************************************
* Copyright (c) 2008-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#ifndef __OPENCL_CL_EGL_H
#define __OPENCL_CL_EGL_H
#include <CL/cl.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Command type for events created with clEnqueueAcquireEGLObjectsKHR */
#define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F
#define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D
#define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E
/* Error type for clCreateFromEGLImageKHR */
#define CL_INVALID_EGL_OBJECT_KHR -1093
#define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092
/* CLeglImageKHR is an opaque handle to an EGLImage */
typedef void* CLeglImageKHR;
/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
typedef void* CLeglDisplayKHR;
/* CLeglSyncKHR is an opaque handle to an EGLSync object */
typedef void* CLeglSyncKHR;
/* properties passed to clCreateFromEGLImageKHR */
typedef intptr_t cl_egl_image_properties_khr;
#define cl_khr_egl_image 1
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromEGLImageKHR(cl_context context,
CLeglDisplayKHR egldisplay,
CLeglImageKHR eglimage,
cl_mem_flags flags,
const cl_egl_image_properties_khr * properties,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)(
cl_context context,
CLeglDisplayKHR egldisplay,
CLeglImageKHR eglimage,
cl_mem_flags flags,
const cl_egl_image_properties_khr * properties,
cl_int * errcode_ret);
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueAcquireEGLObjectsKHR(cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event);
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReleaseEGLObjectsKHR(cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event);
#define cl_khr_egl_event 1
extern CL_API_ENTRY cl_event CL_API_CALL
clCreateEventFromEGLSyncKHR(cl_context context,
CLeglSyncKHR sync,
CLeglDisplayKHR display,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
cl_context context,
CLeglSyncKHR sync,
CLeglDisplayKHR display,
cl_int * errcode_ret);
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_EGL_H */
/*******************************************************************************
* Copyright (c) 2008-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
#include <CL/cl_ext.h>
#pragma message("The Intel extensions have been moved into cl_ext.h. Please include cl_ext.h directly.")
/*******************************************************************************
* Copyright (c) 2008-2021 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#ifndef __OPENCL_CL_GL_H
#define __OPENCL_CL_GL_H
#include <CL/cl.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef cl_uint cl_gl_object_type;
typedef cl_uint cl_gl_texture_info;
typedef cl_uint cl_gl_platform_info;
typedef struct __GLsync *cl_GLsync;
/* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */
#define CL_GL_OBJECT_BUFFER 0x2000
#define CL_GL_OBJECT_TEXTURE2D 0x2001
#define CL_GL_OBJECT_TEXTURE3D 0x2002
#define CL_GL_OBJECT_RENDERBUFFER 0x2003
#ifdef CL_VERSION_1_2
#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E
#define CL_GL_OBJECT_TEXTURE1D 0x200F
#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010
#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011
#endif
/* cl_gl_texture_info */
#define CL_GL_TEXTURE_TARGET 0x2004
#define CL_GL_MIPMAP_LEVEL 0x2005
#ifdef CL_VERSION_1_2
#define CL_GL_NUM_SAMPLES 0x2012
#endif
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLBuffer(cl_context context,
cl_mem_flags flags,
cl_GLuint bufobj,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
#ifdef CL_VERSION_1_2
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLTexture(cl_context context,
cl_mem_flags flags,
cl_GLenum target,
cl_GLint miplevel,
cl_GLuint texture,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
#endif
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromGLRenderbuffer(cl_context context,
cl_mem_flags flags,
cl_GLuint renderbuffer,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLObjectInfo(cl_mem memobj,
cl_gl_object_type * gl_object_type,
cl_GLuint * gl_object_name) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLTextureInfo(cl_mem memobj,
cl_gl_texture_info param_name,
size_t param_value_size,
void * param_value,
size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueAcquireGLObjects(cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReleaseGLObjects(cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
cl_uint num_events_in_wait_list,
const cl_event * event_wait_list,
cl_event * event) CL_API_SUFFIX__VERSION_1_0;
/* Deprecated OpenCL 1.1 APIs */
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateFromGLTexture2D(cl_context context,
cl_mem_flags flags,
cl_GLenum target,
cl_GLint miplevel,
cl_GLuint texture,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
clCreateFromGLTexture3D(cl_context context,
cl_mem_flags flags,
cl_GLenum target,
cl_GLint miplevel,
cl_GLuint texture,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
/* cl_khr_gl_sharing extension */
#define cl_khr_gl_sharing 1
typedef cl_uint cl_gl_context_info;
/* Additional Error Codes */
#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
/* cl_gl_context_info */
#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
/* Additional cl_context_properties */
#define CL_GL_CONTEXT_KHR 0x2008
#define CL_EGL_DISPLAY_KHR 0x2009
#define CL_GLX_DISPLAY_KHR 0x200A
#define CL_WGL_HDC_KHR 0x200B
#define CL_CGL_SHAREGROUP_KHR 0x200C
extern CL_API_ENTRY cl_int CL_API_CALL
clGetGLContextInfoKHR(const cl_context_properties * properties,
cl_gl_context_info param_name,
size_t param_value_size,
void * param_value,
size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
const cl_context_properties * properties,
cl_gl_context_info param_name,
size_t param_value_size,
void * param_value,
size_t * param_value_size_ret);
/*
* cl_khr_gl_event extension
*/
#define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D
extern CL_API_ENTRY cl_event CL_API_CALL
clCreateEventFromGLsyncKHR(cl_context context,
cl_GLsync sync,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_1;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_GL_H */
/*******************************************************************************
* Copyright (c) 2008-2021 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#include <CL/cl_gl.h>
#pragma message("All OpenGL-related extensions have been moved into cl_gl.h. Please include cl_gl.h directly.")
/*
* Copyright (c) 2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* OpenCL is a trademark of Apple Inc. used under license by Khronos.
*/
#ifndef OPENCL_CL_LAYER_H
#define OPENCL_CL_LAYER_H
#include <CL/cl_icd.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef cl_uint cl_layer_info;
typedef cl_uint cl_layer_api_version;
#define CL_LAYER_API_VERSION 0x4240
#define CL_LAYER_API_VERSION_100 100
extern CL_API_ENTRY cl_int CL_API_CALL
clGetLayerInfo(cl_layer_info param_name,
size_t param_value_size,
void *param_value,
size_t *param_value_size_ret);
CL_API_ENTRY typedef cl_int
(CL_API_CALL *pfn_clGetLayerInfo)(cl_layer_info param_name,
size_t param_value_size,
void *param_value,
size_t *param_value_size_ret);
extern CL_API_ENTRY cl_int CL_API_CALL
clInitLayer(cl_uint num_entries,
const cl_icd_dispatch *target_dispatch,
cl_uint *num_entries_ret,
const cl_icd_dispatch **layer_dispatch_ret);
CL_API_ENTRY typedef cl_int
(CL_API_CALL *pfn_clInitLayer)(cl_uint num_entries,
const cl_icd_dispatch *target_dispatch,
cl_uint *num_entries_ret,
const cl_icd_dispatch **layer_dispatch_ret);
#ifdef __cplusplus
}
#endif
#endif /* OPENCL_CL_LAYER_H */
/*******************************************************************************
* Copyright (c) 2008-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#ifndef __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
#define __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H
#include <CL/cl.h>
#include <CL/cl_platform.h>
#include <va/va.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************
* cl_intel_va_api_media_sharing extension *
*******************************************/
#define cl_intel_va_api_media_sharing 1
/* error codes */
#define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098
#define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099
#define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100
#define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101
/* cl_va_api_device_source_intel */
#define CL_VA_API_DISPLAY_INTEL 0x4094
/* cl_va_api_device_set_intel */
#define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095
#define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096
/* cl_context_info */
#define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097
/* cl_mem_info */
#define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098
/* cl_image_info */
#define CL_IMAGE_VA_API_PLANE_INTEL 0x4099
/* cl_command_type */
#define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A
#define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B
typedef cl_uint cl_va_api_device_source_intel;
typedef cl_uint cl_va_api_device_set_intel;
extern CL_API_ENTRY cl_int CL_API_CALL
clGetDeviceIDsFromVA_APIMediaAdapterINTEL(
cl_platform_id platform,
cl_va_api_device_source_intel media_adapter_type,
void* media_adapter,
cl_va_api_device_set_intel media_adapter_set,
cl_uint num_entries,
cl_device_id* devices,
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL * clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn)(
cl_platform_id platform,
cl_va_api_device_source_intel media_adapter_type,
void* media_adapter,
cl_va_api_device_set_intel media_adapter_set,
cl_uint num_entries,
cl_device_id* devices,
cl_uint* num_devices) CL_EXT_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_mem CL_API_CALL
clCreateFromVA_APIMediaSurfaceINTEL(
cl_context context,
cl_mem_flags flags,
VASurfaceID* surface,
cl_uint plane,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_mem (CL_API_CALL * clCreateFromVA_APIMediaSurfaceINTEL_fn)(
cl_context context,
cl_mem_flags flags,
VASurfaceID* surface,
cl_uint plane,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueAcquireVA_APIMediaSurfacesINTEL(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueReleaseVA_APIMediaSurfacesINTEL(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event) CL_EXT_SUFFIX__VERSION_1_2;
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H */
/*******************************************************************************
* Copyright (c) 2018-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#ifndef __CL_VERSION_H
#define __CL_VERSION_H
/* Detect which version to target */
#if !defined(CL_TARGET_OPENCL_VERSION)
#pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)")
#define CL_TARGET_OPENCL_VERSION 300
#endif
#if CL_TARGET_OPENCL_VERSION != 100 && \
CL_TARGET_OPENCL_VERSION != 110 && \
CL_TARGET_OPENCL_VERSION != 120 && \
CL_TARGET_OPENCL_VERSION != 200 && \
CL_TARGET_OPENCL_VERSION != 210 && \
CL_TARGET_OPENCL_VERSION != 220 && \
CL_TARGET_OPENCL_VERSION != 300
#pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220, 300). Defaulting to 300 (OpenCL 3.0)")
#undef CL_TARGET_OPENCL_VERSION
#define CL_TARGET_OPENCL_VERSION 300
#endif
/* OpenCL Version */
#if CL_TARGET_OPENCL_VERSION >= 300 && !defined(CL_VERSION_3_0)
#define CL_VERSION_3_0 1
#endif
#if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2)
#define CL_VERSION_2_2 1
#endif
#if CL_TARGET_OPENCL_VERSION >= 210 && !defined(CL_VERSION_2_1)
#define CL_VERSION_2_1 1
#endif
#if CL_TARGET_OPENCL_VERSION >= 200 && !defined(CL_VERSION_2_0)
#define CL_VERSION_2_0 1
#endif
#if CL_TARGET_OPENCL_VERSION >= 120 && !defined(CL_VERSION_1_2)
#define CL_VERSION_1_2 1
#endif
#if CL_TARGET_OPENCL_VERSION >= 110 && !defined(CL_VERSION_1_1)
#define CL_VERSION_1_1 1
#endif
#if CL_TARGET_OPENCL_VERSION >= 100 && !defined(CL_VERSION_1_0)
#define CL_VERSION_1_0 1
#endif
/* Allow deprecated APIs for older OpenCL versions. */
#if CL_TARGET_OPENCL_VERSION <= 220 && !defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS)
#define CL_USE_DEPRECATED_OPENCL_2_2_APIS
#endif
#if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS)
#define CL_USE_DEPRECATED_OPENCL_2_1_APIS
#endif
#if CL_TARGET_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS)
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
#endif
#if CL_TARGET_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS)
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#endif
#if CL_TARGET_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS)
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
#endif
#if CL_TARGET_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS)
#define CL_USE_DEPRECATED_OPENCL_1_0_APIS
#endif
#endif /* __CL_VERSION_H */
/*******************************************************************************
* Copyright (c) 2008-2021 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
#ifndef __OPENCL_H
#define __OPENCL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <CL/cl.h>
#include <CL/cl_ext.h>
#include <CL/cl_gl.h>
#ifdef __cplusplus
}
#endif
#endif /* __OPENCL_H */
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
#if !defined(ANGLE_EXPORT) #if !defined(ANGLE_EXPORT)
# if defined(_WIN32) # if defined(_WIN32)
# if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \ # if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \
defined(LIBFEATURE_SUPPORT_IMPLEMENTATION) defined(LIBFEATURE_SUPPORT_IMPLEMENTATION) || defined(LIBCL_IMPLEMENTATION)
# define ANGLE_EXPORT __declspec(dllexport) # define ANGLE_EXPORT __declspec(dllexport)
# else # else
# define ANGLE_EXPORT __declspec(dllimport) # define ANGLE_EXPORT __declspec(dllimport)
# endif # endif
# elif defined(__GNUC__) # elif defined(__GNUC__)
# if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \ # if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \
defined(LIBFEATURE_SUPPORT_IMPLEMENTATION) defined(LIBFEATURE_SUPPORT_IMPLEMENTATION) || defined(LIBCL_IMPLEMENTATION)
# define ANGLE_EXPORT __attribute__((visibility("default"))) # define ANGLE_EXPORT __attribute__((visibility("default")))
# else # else
# define ANGLE_EXPORT # define ANGLE_EXPORT
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"574c34b93db348eb2e13d8026c3014ff", "7e9b9e8b735dadb417b2d10434f56a41",
"scripts/wgl.xml": "scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db", "c36001431919e1c435f1215a85f7e1db",
"src/libEGL/egl_loader_autogen.cpp": "src/libEGL/egl_loader_autogen.cpp":
......
{ {
"scripts/cl.xml":
"c7b7bf8184d73c991f3a1ca11e882894",
"scripts/egl.xml": "scripts/egl.xml":
"013c552e6c523abdcf268268ea47e9fe", "013c552e6c523abdcf268268ea47e9fe",
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
...@@ -8,13 +10,13 @@ ...@@ -8,13 +10,13 @@
"scripts/entry_point_packed_gl_enums.json": "scripts/entry_point_packed_gl_enums.json":
"4f7b43863a5e61991bba4010db463679", "4f7b43863a5e61991bba4010db463679",
"scripts/generate_entry_points.py": "scripts/generate_entry_points.py":
"09729fe8be0f242cc97058c2b5ab7310", "1c1f236f9804be736409ffffc0869662",
"scripts/gl.xml": "scripts/gl.xml":
"f66967f3f3d696b5d8306fd80bbd49a8", "f66967f3f3d696b5d8306fd80bbd49a8",
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"574c34b93db348eb2e13d8026c3014ff", "7e9b9e8b735dadb417b2d10434f56a41",
"scripts/wgl.xml": "scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db", "c36001431919e1c435f1215a85f7e1db",
"src/common/entry_points_enum_autogen.cpp": "src/common/entry_points_enum_autogen.cpp":
...@@ -162,5 +164,9 @@ ...@@ -162,5 +164,9 @@
"src/libGLESv2/libGLESv2_no_capture_autogen.def": "src/libGLESv2/libGLESv2_no_capture_autogen.def":
"a29336a4763b0ed66b9ddfe4847f68da", "a29336a4763b0ed66b9ddfe4847f68da",
"src/libGLESv2/libGLESv2_with_capture_autogen.def": "src/libGLESv2/libGLESv2_with_capture_autogen.def":
"301a20588e14724b390409c71d5ccfcd" "301a20588e14724b390409c71d5ccfcd",
"src/libOpenCL/entry_points_cl_autogen.cpp":
"359093faf2a825d10384d301009ad5b5",
"src/libOpenCL/entry_points_cl_autogen.h":
"3b4a3094e8fd9082b71915b5bd1e8fee"
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"574c34b93db348eb2e13d8026c3014ff", "7e9b9e8b735dadb417b2d10434f56a41",
"src/libANGLE/capture/gl_enum_utils_autogen.cpp": "src/libANGLE/capture/gl_enum_utils_autogen.cpp":
"9517df43e12c9d27cdf40a0db05bc85b", "9517df43e12c9d27cdf40a0db05bc85b",
"src/libANGLE/capture/gl_enum_utils_autogen.h": "src/libANGLE/capture/gl_enum_utils_autogen.h":
......
{ {
"scripts/cl.xml":
"c7b7bf8184d73c991f3a1ca11e882894",
"scripts/egl.xml": "scripts/egl.xml":
"013c552e6c523abdcf268268ea47e9fe", "013c552e6c523abdcf268268ea47e9fe",
"scripts/egl_angle_ext.xml": "scripts/egl_angle_ext.xml":
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
"scripts/gl_angle_ext.xml": "scripts/gl_angle_ext.xml":
"0b4f3476d76a5ccc40af342d6c08739d", "0b4f3476d76a5ccc40af342d6c08739d",
"scripts/registry_xml.py": "scripts/registry_xml.py":
"574c34b93db348eb2e13d8026c3014ff", "7e9b9e8b735dadb417b2d10434f56a41",
"scripts/wgl.xml": "scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db", "c36001431919e1c435f1215a85f7e1db",
"src/libGL/proc_table_wgl_autogen.cpp": "src/libGL/proc_table_wgl_autogen.cpp":
......
...@@ -245,6 +245,28 @@ TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN = """\ ...@@ -245,6 +245,28 @@ TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN = """\
}} }}
""" """
TEMPLATE_CL_ENTRY_POINT_NO_RETURN = """\
void CL_API_ENTRY CL_{name}({params})
{{
// TODO: CL_EVENT
// CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
// TODO: {name}
}}
"""
TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\
{return_type}CL_API_ENTRY CL_{name}({params})
{{
// TODO: CL_EVENT
// CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
// TODO: {name}
return ({return_type})0;
}}
"""
TEMPLATE_EGL_STUBS_HEADER = """\ TEMPLATE_EGL_STUBS_HEADER = """\
// GENERATED FILE - DO NOT EDIT. // GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}. // Generated by {script_name} using data from {data_source_name}.
...@@ -599,6 +621,84 @@ FORMAT_DICT = { ...@@ -599,6 +621,84 @@ FORMAT_DICT = {
"LPCSTR": POINTER_FORMAT, "LPCSTR": POINTER_FORMAT,
"LPGLYPHMETRICSFLOAT": POINTER_FORMAT, "LPGLYPHMETRICSFLOAT": POINTER_FORMAT,
"UINT": "%u", "UINT": "%u",
# CL-specific types
"size_t": "%u",
"cl_char": "%d",
"cl_uchar": "%u",
"cl_short": "%d",
"cl_ushort": "%u",
"cl_int": "%d",
"cl_uint": "%u",
"cl_long": "%d",
"cl_ulong": "%u",
"cl_half": "%lf",
"cl_float": "%lf",
"cl_double": "%lf",
"cl_platform_id": POINTER_FORMAT,
"cl_device_id": POINTER_FORMAT,
"cl_context": POINTER_FORMAT,
"cl_command_queue": POINTER_FORMAT,
"cl_mem": POINTER_FORMAT,
"cl_program": POINTER_FORMAT,
"cl_kernel": POINTER_FORMAT,
"cl_event": POINTER_FORMAT,
"cl_program": POINTER_FORMAT,
"cl_sampler": POINTER_FORMAT,
"cl_bool": "%u",
"cl_bitfield": "%u",
"cl_properties": "%u",
"cl_device_type": "%u",
"cl_platform_info": "%u",
"cl_device_info": "%u",
"cl_platform_info": "%u",
"cl_device_fp_config": "%u",
"cl_device_mem_cache_type": "%u",
"cl_device_local_mem_type": "%u",
"cl_device_exec_capabilities": "%u",
"cl_device_svm_capabilities": "%u",
"cl_command_queue_properties": "%u",
"cl_device_partition_property": "%u",
"cl_device_affinity_domain": "%u",
"cl_context_properties": "%u",
"cl_context_info": "%u",
"cl_queue_properties": "%u",
"cl_command_queue_info": "%u",
"cl_channel_order": "%u",
"cl_channel_type": "%u",
"cl_mem_flags": "%u",
"cl_svm_mem_flags": "%u",
"cl_mem_object_type": "%u",
"cl_mem_info": "%u",
"cl_mem_migration_flags": "%u",
"cl_image_info": "%u",
"cl_buffer_create_type": "%u",
"cl_addressing_mode": "%u",
"cl_filter_mode": "%u",
"cl_sampler_info": "%u",
"cl_map_flags": "%u",
"cl_pipe_properties": "%u",
"cl_pipe_info": "%u",
"cl_program_info": "%u",
"cl_program_build_info": "%u",
"cl_program_binary_type": "%u",
"cl_build_status": "%u",
"cl_kernel_info": "%u",
"cl_kernel_arg_info": "%u",
"cl_kernel_arg_address_qualifier": "%u",
"cl_kernel_arg_access_qualifier": "%u",
"cl_kernel_arg_type_qualifier": "%u",
"cl_kernel_work_group_info": "%u",
"cl_kernel_sub_group_info": "%u",
"cl_event_info": "%u",
"cl_command_type": "%u",
"cl_profiling_info": "%u",
"cl_sampler_properties": "%u",
"cl_kernel_exec_info": "%u",
"cl_device_atomic_capabilities": "%u",
"cl_device_device_enqueue_capabilities": "%u",
"cl_khronos_vendor_id": "%u",
"cl_mem_properties": "%u",
"cl_version": "%u",
} }
TEMPLATE_HEADER_INCLUDES = """\ TEMPLATE_HEADER_INCLUDES = """\
...@@ -781,6 +881,16 @@ void EnsureEGLLoaded() {} ...@@ -781,6 +881,16 @@ void EnsureEGLLoaded() {}
} // anonymous namespace } // anonymous namespace
""" """
LIBCL_HEADER_INCLUDES = """\
#include "export.h"
#include <CL/cl.h>
"""
LIBCL_SOURCE_INCLUDES = """\
#include "entry_points_cl_autogen.h"
"""
TEMPLATE_EVENT_COMMENT = """\ TEMPLATE_EVENT_COMMENT = """\
// Don't run the EVENT() macro on the EXT_debug_marker entry points. // Don't run the EVENT() macro on the EXT_debug_marker entry points.
// It can interfere with the debug events being set by the caller. // It can interfere with the debug events being set by the caller.
...@@ -1012,12 +1122,27 @@ def is_aliasing_excepted(api, cmd_name): ...@@ -1012,12 +1122,27 @@ def is_aliasing_excepted(api, cmd_name):
return api == apis.GLES and cmd_name in ALIASING_EXCEPTIONS return api == apis.GLES and cmd_name in ALIASING_EXCEPTIONS
def entry_point_prefix(api):
if api == apis.GLES:
return "GL"
return api
def get_api_entry_def(api):
if api == apis.EGL:
return "EGLAPIENTRY"
elif api == apis.CL:
return "CL_API_ENTRY"
else:
return "GL_APIENTRY"
def format_entry_point_decl(api, cmd_name, proto, params, is_explicit_context): def format_entry_point_decl(api, cmd_name, proto, params, is_explicit_context):
comma_if_needed = ", " if len(params) > 0 else "" comma_if_needed = ", " if len(params) > 0 else ""
stripped = strip_api_prefix(cmd_name) stripped = strip_api_prefix(cmd_name)
return TEMPLATE_ENTRY_POINT_DECL.format( return TEMPLATE_ENTRY_POINT_DECL.format(
export_def="EGLAPIENTRY" if api == apis.EGL else "GL_APIENTRY", export_def=get_api_entry_def(api),
name="%s_%s" % (("EGL" if api == apis.EGL else "GL"), stripped), name="%s_%s" % (entry_point_prefix(api), stripped),
return_type=proto[:-len(cmd_name)], return_type=proto[:-len(cmd_name)],
params=", ".join(params), params=", ".join(params),
comma_if_needed=comma_if_needed, comma_if_needed=comma_if_needed,
...@@ -1034,12 +1159,12 @@ def type_name_sep_index(param): ...@@ -1034,12 +1159,12 @@ def type_name_sep_index(param):
def just_the_type(param): def just_the_type(param):
if "*" in param: if "*" in param:
return param[:type_name_sep_index(param) + 1] return param[:type_name_sep_index(param) + 1].strip()
return param[:type_name_sep_index(param)] return param[:type_name_sep_index(param)].strip()
def just_the_name(param): def just_the_name(param):
return param[type_name_sep_index(param) + 1:] return param[type_name_sep_index(param) + 1:].strip()
def make_param(param_type, param_name): def make_param(param_type, param_name):
...@@ -1070,6 +1195,11 @@ def param_print_argument(command_node, param): ...@@ -1070,6 +1195,11 @@ def param_print_argument(command_node, param):
name_only = just_the_name(param) name_only = just_the_name(param)
type_only = just_the_type(param) type_only = just_the_type(param)
if "*" not in param and type_only not in FORMAT_DICT:
print(" ".join(param))
raise Exception("Missing '%s %s' from '%s' entry point" %
(type_only, name_only, registry_xml.get_cmd_name(command_node)))
if "*" in param or FORMAT_DICT[type_only] == POINTER_FORMAT: if "*" in param or FORMAT_DICT[type_only] == POINTER_FORMAT:
return "(uintptr_t)%s" % name_only return "(uintptr_t)%s" % name_only
...@@ -1193,11 +1323,15 @@ def get_def_template(api, return_type): ...@@ -1193,11 +1323,15 @@ def get_def_template(api, return_type):
if return_type.strip() == "void": if return_type.strip() == "void":
if api == apis.EGL: if api == apis.EGL:
return TEMPLATE_EGL_ENTRY_POINT_NO_RETURN return TEMPLATE_EGL_ENTRY_POINT_NO_RETURN
elif api == apis.CL:
return TEMPLATE_CL_ENTRY_POINT_NO_RETURN
else: else:
return TEMPLATE_GLES_ENTRY_POINT_NO_RETURN return TEMPLATE_GLES_ENTRY_POINT_NO_RETURN
else: else:
if api == apis.EGL: if api == apis.EGL:
return TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN return TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN
elif api == apis.CL:
return TEMPLATE_CL_ENTRY_POINT_WITH_RETURN
else: else:
return TEMPLATE_GLES_ENTRY_POINT_WITH_RETURN return TEMPLATE_GLES_ENTRY_POINT_WITH_RETURN
...@@ -1558,6 +1692,19 @@ class EGLEntryPoints(ANGLEEntryPoints): ...@@ -1558,6 +1692,19 @@ class EGLEntryPoints(ANGLEEntryPoints):
return cls._packed_enums return cls._packed_enums
class CLEntryPoints(ANGLEEntryPoints):
all_param_types = set()
def __init__(self, xml, commands):
super().__init__(apis.CL, xml, commands, CLEntryPoints.all_param_types,
CLEntryPoints.get_packed_enums())
@classmethod
def get_packed_enums(cls):
return {}
def get_decls(api, def get_decls(api,
formatter, formatter,
all_commands, all_commands,
...@@ -2192,6 +2339,8 @@ def main(): ...@@ -2192,6 +2339,8 @@ def main():
outputs = [ outputs = [
EGL_STUBS_HEADER_PATH, EGL_STUBS_HEADER_PATH,
EGL_EXT_STUBS_HEADER_PATH, EGL_EXT_STUBS_HEADER_PATH,
'../src/libOpenCL/entry_points_cl_autogen.cpp',
'../src/libOpenCL/entry_points_cl_autogen.h',
'../src/common/entry_points_enum_autogen.cpp', '../src/common/entry_points_enum_autogen.cpp',
'../src/common/entry_points_enum_autogen.h', '../src/common/entry_points_enum_autogen.h',
'../src/libANGLE/Context_gl_1_autogen.h', '../src/libANGLE/Context_gl_1_autogen.h',
...@@ -2715,6 +2864,49 @@ def main(): ...@@ -2715,6 +2864,49 @@ def main():
write_capture_replay_source(apis.GLES, xml.all_commands, all_commands_no_suffix, write_capture_replay_source(apis.GLES, xml.all_commands, all_commands_no_suffix,
GLEntryPoints.get_packed_enums(), []) GLEntryPoints.get_packed_enums(), [])
# OpenCL
clxml = registry_xml.RegistryXML('cl.xml')
cl_validation_protos = []
cl_decls = []
cl_defs = []
libcl_ep_defs = []
libcl_windows_def_exports = []
cl_commands = []
for major_version, minor_version in registry_xml.CL_VERSIONS:
version = "%d_%d" % (major_version, minor_version)
annotation = "CL_%s" % version
name_prefix = "CL_VERSION_"
comment = version.replace("_", ".")
feature_name = "%s%s" % (name_prefix, version)
clxml.AddCommands(feature_name, version)
cl_version_commands = clxml.commands[version]
cl_commands += cl_version_commands
# Spec revs may have no new commands.
if not cl_version_commands:
continue
eps = CLEntryPoints(clxml, cl_version_commands)
comment = "\n// CL %d.%d" % (major_version, minor_version)
win_def_comment = "\n ; CL %d.%d" % (major_version, minor_version)
cl_decls += [comment] + eps.decls
cl_defs += [comment] + eps.defs
libcl_ep_defs += [comment] + eps.export_defs
cl_validation_protos += [comment] + eps.validation_protos
libcl_windows_def_exports += [win_def_comment] + get_exports(clxml.commands[version])
write_file("cl", "CL", TEMPLATE_ENTRY_POINT_HEADER, "\n".join(cl_decls), "h",
LIBCL_HEADER_INCLUDES, "libOpenCL", "cl.xml")
write_file("cl", "CL", TEMPLATE_ENTRY_POINT_SOURCE, "\n".join(cl_defs), "cpp",
LIBCL_SOURCE_INCLUDES, "libOpenCL", "cl.xml")
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(main()) sys.exit(main())
...@@ -17,6 +17,7 @@ import xml.etree.ElementTree as etree ...@@ -17,6 +17,7 @@ import xml.etree.ElementTree as etree
from enum import Enum from enum import Enum
xml_inputs = [ xml_inputs = [
'cl.xml',
'gl.xml', 'gl.xml',
'gl_angle_ext.xml', 'gl_angle_ext.xml',
'egl.xml', 'egl.xml',
...@@ -220,6 +221,7 @@ DESKTOP_GL_VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 0), ( ...@@ -220,6 +221,7 @@ DESKTOP_GL_VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 0), (
GLES_VERSIONS = [(2, 0), (3, 0), (3, 1), (3, 2), (1, 0)] GLES_VERSIONS = [(2, 0), (3, 0), (3, 1), (3, 2), (1, 0)]
EGL_VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5)] EGL_VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5)]
WGL_VERSIONS = [(1, 0)] WGL_VERSIONS = [(1, 0)]
CL_VERSIONS = [(1, 0)]
# API types # API types
...@@ -228,6 +230,7 @@ class apis: ...@@ -228,6 +230,7 @@ class apis:
GLES = 'GLES' GLES = 'GLES'
WGL = 'WGL' WGL = 'WGL'
EGL = 'EGL' EGL = 'EGL'
CL = 'CL'
def script_relative(path): def script_relative(path):
...@@ -239,7 +242,13 @@ def path_to(folder, file): ...@@ -239,7 +242,13 @@ def path_to(folder, file):
def strip_api_prefix(cmd_name): def strip_api_prefix(cmd_name):
return cmd_name.lstrip("wegl") return cmd_name.lstrip("cwegl")
def get_cmd_name(command_node):
proto = command_node.find('proto')
cmd_name = proto.find('name').text
return cmd_name
class CommandNames: class CommandNames:
...@@ -374,8 +383,7 @@ class EntryPoints: ...@@ -374,8 +383,7 @@ class EntryPoints:
self._cmd_info = [] self._cmd_info = []
for command_node in xml.all_commands: for command_node in xml.all_commands:
proto = command_node.find('proto') cmd_name = get_cmd_name(command_node)
cmd_name = proto.find('name').text
if api == apis.WGL: if api == apis.WGL:
cmd_name = cmd_name if cmd_name[:3] == 'wgl' else 'wgl' + cmd_name cmd_name = cmd_name if cmd_name[:3] == 'wgl' else 'wgl' + cmd_name
...@@ -384,6 +392,12 @@ class EntryPoints: ...@@ -384,6 +392,12 @@ class EntryPoints:
continue continue
param_text = ["".join(param.itertext()) for param in command_node.findall('param')] param_text = ["".join(param.itertext()) for param in command_node.findall('param')]
# Treat (void) as ()
if len(param_text) == 1 and param_text[0].strip() == 'void':
param_text = []
proto = command_node.find('proto')
proto_text = "".join(proto.itertext()) proto_text = "".join(proto.itertext())
self._cmd_info.append((cmd_name, command_node, param_text, proto_text)) self._cmd_info.append((cmd_name, command_node, param_text, proto_text))
......
# Copyright 2021 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Build configuration for OpenCL-related targets.
import("../../gni/angle.gni")
angle_source_set("cl_includes") {
sources = [
"../../include/CL/cl.h",
"../../include/CL/cl_d3d10.h",
"../../include/CL/cl_d3d11.h",
"../../include/CL/cl_dx9_media_sharing.h",
"../../include/CL/cl_dx9_media_sharing_intel.h",
"../../include/CL/cl_egl.h",
"../../include/CL/cl_ext.h",
"../../include/CL/cl_ext_intel.h",
"../../include/CL/cl_gl.h",
"../../include/CL/cl_gl_ext.h",
"../../include/CL/cl_half.h",
"../../include/CL/cl_icd.h",
"../../include/CL/cl_layer.h",
"../../include/CL/cl_platform.h",
"../../include/CL/cl_va_api_media_sharing_intel.h",
"../../include/CL/cl_version.h",
"../../include/CL/opencl.h",
"../../include/export.h",
]
}
angle_shared_library("OpenCL") {
defines = [
"CL_TARGET_OPENCL_VERSION=100",
"LIBCL_IMPLEMENTATION",
]
sources = [
"entry_points_cl_autogen.cpp",
"entry_points_cl_autogen.h",
]
deps = [ ":cl_includes" ]
}
group("angle_cl") {
data_deps = [ ":OpenCL" ]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment