Commit 2489a0c1 by John Plate Committed by Commit Bot

Fixed OpenCL headers for Windows

Bug: angleproject:5761 Change-Id: I29d1fd3bf862728a3e78418a4f98219828394452 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2807717 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 15b34197
DisableFormat: true
SortIncludes: false
# ANGLE OpenCL Headers
The OpenCL headers ANGLE uses are the original headers from Khronos, but they are modified to allow
the macro `CL_API_ENTRY` to be overridden externally.
The modifications have been [submitted](https://github.com/KhronosGroup/OpenCL-Headers/pull/162) to
Khronos, and this document should be updated after they are merged.
### Regenerating headers
1. Clone [https://github.com/KhronosGroup/OpenCL-Headers.git](https://github.com/KhronosGroup/OpenCL-Headers.git).
1. Copy all headers from `OpenCL-Headers/CL/` over to this folder.
1. Edit the headers:
* Change all occurences of `typedef CL_API_ENTRY` to `typedef`.
* In `cl_platform.h` change both `#define CL_API_ENTRY` to
```
#if !defined(CL_API_ENTRY)
#define CL_API_ENTRY
#endif
```
......@@ -75,7 +75,7 @@ typedef cl_uint cl_d3d10_device_set_khr;
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
typedef cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
cl_platform_id platform,
cl_d3d10_device_source_khr d3d_device_source,
void * d3d_object,
......@@ -84,27 +84,27 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
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)(
typedef 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)(
typedef 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)(
typedef 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)(
typedef cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
......@@ -112,7 +112,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
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)(
typedef cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
......
......@@ -75,7 +75,7 @@ typedef cl_uint cl_d3d11_device_set_khr;
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
typedef cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
cl_platform_id platform,
cl_d3d11_device_source_khr d3d_device_source,
void * d3d_object,
......@@ -84,27 +84,27 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)(
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)(
typedef 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)(
typedef 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)(
typedef 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)(
typedef cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
......@@ -112,7 +112,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)(
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)(
typedef cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
......
......@@ -76,7 +76,7 @@ typedef struct _cl_dx9_surface_info_khr
/******************************************************************************/
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)(
typedef 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,
......@@ -86,7 +86,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_f
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)(
typedef cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)(
cl_context context,
cl_mem_flags flags,
cl_dx9_media_adapter_type_khr adapter_type,
......@@ -94,7 +94,7 @@ typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)(
cl_uint plane,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)(
typedef cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
......@@ -102,7 +102,7 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn
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)(
typedef cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
......@@ -161,7 +161,7 @@ clGetDeviceIDsFromDX9INTEL(
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)(
typedef cl_int (CL_API_CALL* clGetDeviceIDsFromDX9INTEL_fn)(
cl_platform_id platform,
cl_dx9_device_source_intel dx9_device_source,
void* dx9_object,
......@@ -179,7 +179,7 @@ clCreateFromDX9MediaSurfaceINTEL(
UINT plane,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceINTEL_fn)(
typedef cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceINTEL_fn)(
cl_context context,
cl_mem_flags flags,
IDirect3DSurface9* resource,
......@@ -196,7 +196,7 @@ clEnqueueAcquireDX9ObjectsINTEL(
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)(
typedef cl_int (CL_API_CALL *clEnqueueAcquireDX9ObjectsINTEL_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
......@@ -213,7 +213,7 @@ clEnqueueReleaseDX9ObjectsINTEL(
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)(
typedef cl_int (CL_API_CALL *clEnqueueReleaseDX9ObjectsINTEL_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
cl_mem* mem_objects,
......
......@@ -56,7 +56,7 @@ clCreateFromEGLImageKHR(cl_context context,
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)(
typedef cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)(
cl_context context,
CLeglDisplayKHR egldisplay,
CLeglImageKHR eglimage,
......@@ -73,7 +73,7 @@ clEnqueueAcquireEGLObjectsKHR(cl_command_queue command_queue,
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)(
typedef cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
......@@ -90,7 +90,7 @@ clEnqueueReleaseEGLObjectsKHR(cl_command_queue command_queue,
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)(
typedef cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem * mem_objects,
......@@ -107,7 +107,7 @@ clCreateEventFromEGLSyncKHR(cl_context context,
CLeglDisplayKHR display,
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
typedef cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)(
cl_context context,
CLeglSyncKHR sync,
CLeglDisplayKHR display,
......
......@@ -102,7 +102,7 @@ clIcdGetPlatformIDsKHR(cl_uint num_entries,
cl_platform_id * platforms,
cl_uint * num_platforms);
typedef CL_API_ENTRY cl_int
typedef cl_int
(CL_API_CALL *clIcdGetPlatformIDsKHR_fn)(cl_uint num_entries,
cl_platform_id * platforms,
cl_uint * num_platforms);
......@@ -129,7 +129,7 @@ clCreateProgramWithILKHR(cl_context context,
size_t length,
cl_int * errcode_ret);
typedef CL_API_ENTRY cl_program
typedef cl_program
(CL_API_CALL *clCreateProgramWithILKHR_fn)(cl_context context,
const void * il,
size_t length,
......@@ -178,7 +178,7 @@ typedef CL_API_ENTRY cl_program
extern CL_API_ENTRY cl_int CL_API_CALL
clTerminateContextKHR(cl_context context) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int
typedef cl_int
(CL_API_CALL *clTerminateContextKHR_fn)(cl_context context) CL_EXT_SUFFIX__VERSION_1_2;
......@@ -206,7 +206,7 @@ clCreateCommandQueueWithPropertiesKHR(cl_context context,
const cl_queue_properties_khr* properties,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_command_queue
typedef cl_command_queue
(CL_API_CALL *clCreateCommandQueueWithPropertiesKHR_fn)(cl_context context,
cl_device_id device,
const cl_queue_properties_khr* properties,
......@@ -270,13 +270,13 @@ typedef CL_API_ENTRY cl_command_queue
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int
typedef cl_int
(CL_API_CALL *clReleaseDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
extern CL_API_ENTRY cl_int CL_API_CALL
clRetainDeviceEXT(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int
typedef cl_int
(CL_API_CALL *clRetainDeviceEXT_fn)(cl_device_id device) CL_EXT_SUFFIX__VERSION_1_1;
typedef cl_ulong cl_device_partition_property_ext;
......@@ -287,7 +287,7 @@ clCreateSubDevicesEXT(cl_device_id in_device,
cl_device_id * out_devices,
cl_uint * num_devices) CL_EXT_SUFFIX__VERSION_1_1;
typedef CL_API_ENTRY cl_int
typedef cl_int
(CL_API_CALL * clCreateSubDevicesEXT_fn)(cl_device_id in_device,
const cl_device_partition_property_ext * properties,
cl_uint num_entries,
......@@ -346,7 +346,7 @@ clEnqueueMigrateMemObjectEXT(cl_command_queue command_queue,
const cl_event * event_wait_list,
cl_event * event);
typedef CL_API_ENTRY cl_int
typedef cl_int
(CL_API_CALL *clEnqueueMigrateMemObjectEXT_fn)(cl_command_queue command_queue,
cl_uint num_mem_objects,
const cl_mem * mem_objects,
......@@ -566,7 +566,7 @@ clGetKernelSubGroupInfoKHR(cl_kernel in_kernel,
void * param_value,
size_t * param_value_size_ret) CL_EXT_SUFFIX__VERSION_2_0_DEPRECATED;
typedef CL_API_ENTRY cl_int
typedef cl_int
(CL_API_CALL * clGetKernelSubGroupInfoKHR_fn)(cl_kernel in_kernel,
cl_device_id in_device,
cl_kernel_sub_group_info param_name,
......@@ -1068,7 +1068,7 @@ clCreateAcceleratorINTEL(
const void* descriptor,
cl_int* errcode_ret) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_accelerator_intel (CL_API_CALL *clCreateAcceleratorINTEL_fn)(
typedef cl_accelerator_intel (CL_API_CALL *clCreateAcceleratorINTEL_fn)(
cl_context context,
cl_accelerator_type_intel accelerator_type,
size_t descriptor_size,
......@@ -1083,7 +1083,7 @@ clGetAcceleratorInfoINTEL(
void* param_value,
size_t* param_value_size_ret) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetAcceleratorInfoINTEL_fn)(
typedef cl_int (CL_API_CALL *clGetAcceleratorInfoINTEL_fn)(
cl_accelerator_intel accelerator,
cl_accelerator_info_intel param_name,
size_t param_value_size,
......@@ -1094,14 +1094,14 @@ extern CL_API_ENTRY cl_int CL_API_CALL
clRetainAcceleratorINTEL(
cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clRetainAcceleratorINTEL_fn)(
typedef cl_int (CL_API_CALL *clRetainAcceleratorINTEL_fn)(
cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2;
extern CL_API_ENTRY cl_int CL_API_CALL
clReleaseAcceleratorINTEL(
cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2;
typedef CL_API_ENTRY cl_int (CL_API_CALL *clReleaseAcceleratorINTEL_fn)(
typedef cl_int (CL_API_CALL *clReleaseAcceleratorINTEL_fn)(
cl_accelerator_intel accelerator) CL_EXT_SUFFIX__VERSION_1_2;
/******************************************
......@@ -1374,7 +1374,7 @@ clHostMemAllocINTEL(
cl_uint alignment,
cl_int* errcode_ret);
typedef CL_API_ENTRY void* (CL_API_CALL *
typedef void* (CL_API_CALL *
clHostMemAllocINTEL_fn)(
cl_context context,
const cl_mem_properties_intel* properties,
......@@ -1391,7 +1391,7 @@ clDeviceMemAllocINTEL(
cl_uint alignment,
cl_int* errcode_ret);
typedef CL_API_ENTRY void* (CL_API_CALL *
typedef void* (CL_API_CALL *
clDeviceMemAllocINTEL_fn)(
cl_context context,
cl_device_id device,
......@@ -1409,7 +1409,7 @@ clSharedMemAllocINTEL(
cl_uint alignment,
cl_int* errcode_ret);
typedef CL_API_ENTRY void* (CL_API_CALL *
typedef void* (CL_API_CALL *
clSharedMemAllocINTEL_fn)(
cl_context context,
cl_device_id device,
......@@ -1423,7 +1423,7 @@ clMemFreeINTEL(
cl_context context,
void* ptr);
typedef CL_API_ENTRY cl_int (CL_API_CALL *
typedef cl_int (CL_API_CALL *
clMemFreeINTEL_fn)(
cl_context context,
void* ptr);
......@@ -1433,7 +1433,7 @@ clMemBlockingFreeINTEL(
cl_context context,
void* ptr);
typedef CL_API_ENTRY cl_int (CL_API_CALL *
typedef cl_int (CL_API_CALL *
clMemBlockingFreeINTEL_fn)(
cl_context context,
void* ptr);
......@@ -1447,7 +1447,7 @@ clGetMemAllocInfoINTEL(
void* param_value,
size_t* param_value_size_ret);
typedef CL_API_ENTRY cl_int (CL_API_CALL *
typedef cl_int (CL_API_CALL *
clGetMemAllocInfoINTEL_fn)(
cl_context context,
const void* ptr,
......@@ -1462,7 +1462,7 @@ clSetKernelArgMemPointerINTEL(
cl_uint arg_index,
const void* arg_value);
typedef CL_API_ENTRY cl_int (CL_API_CALL *
typedef cl_int (CL_API_CALL *
clSetKernelArgMemPointerINTEL_fn)(
cl_kernel kernel,
cl_uint arg_index,
......@@ -1478,7 +1478,7 @@ clEnqueueMemsetINTEL( /* Deprecated */
const cl_event* event_wait_list,
cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *
typedef cl_int (CL_API_CALL *
clEnqueueMemsetINTEL_fn)( /* Deprecated */
cl_command_queue command_queue,
void* dst_ptr,
......@@ -1499,7 +1499,7 @@ clEnqueueMemFillINTEL(
const cl_event* event_wait_list,
cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *
typedef cl_int (CL_API_CALL *
clEnqueueMemFillINTEL_fn)(
cl_command_queue command_queue,
void* dst_ptr,
......@@ -1521,7 +1521,7 @@ clEnqueueMemcpyINTEL(
const cl_event* event_wait_list,
cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *
typedef cl_int (CL_API_CALL *
clEnqueueMemcpyINTEL_fn)(
cl_command_queue command_queue,
cl_bool blocking,
......@@ -1547,7 +1547,7 @@ clEnqueueMigrateMemINTEL(
const cl_event* event_wait_list,
cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *
typedef cl_int (CL_API_CALL *
clEnqueueMigrateMemINTEL_fn)(
cl_command_queue command_queue,
const void* ptr,
......@@ -1569,7 +1569,7 @@ clEnqueueMemAdviseINTEL(
const cl_event* event_wait_list,
cl_event* event);
typedef CL_API_ENTRY cl_int (CL_API_CALL *
typedef cl_int (CL_API_CALL *
clEnqueueMemAdviseINTEL_fn)(
cl_command_queue command_queue,
const void* ptr,
......@@ -1594,7 +1594,7 @@ clCreateBufferWithPropertiesINTEL(
void * host_ptr,
cl_int * errcode_ret) CL_EXT_SUFFIX__VERSION_1_0;
typedef CL_API_ENTRY cl_mem (CL_API_CALL *
typedef cl_mem (CL_API_CALL *
clCreateBufferWithPropertiesINTEL_fn)(
cl_context context,
const cl_mem_properties_intel* properties,
......
......@@ -145,7 +145,7 @@ clGetGLContextInfoKHR(const cl_context_properties * properties,
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)(
typedef cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(
const cl_context_properties * properties,
cl_gl_context_info param_name,
size_t param_value_size,
......
......@@ -24,11 +24,15 @@ extern "C" {
#endif
#if defined(_WIN32)
#define CL_API_ENTRY
#if !defined(CL_API_ENTRY)
#define CL_API_ENTRY
#endif
#define CL_API_CALL __stdcall
#define CL_CALLBACK __stdcall
#else
#define CL_API_ENTRY
#if !defined(CL_API_ENTRY)
#define CL_API_ENTRY
#endif
#define CL_API_CALL
#define CL_CALLBACK
#endif
......
DisableFormat: true
SortIncludes: false
DisableFormat: true
SortIncludes: false
DisableFormat: true
SortIncludes: false
DisableFormat: true
SortIncludes: false
DisableFormat: true
SortIncludes: false
DisableFormat: true
SortIncludes: false
......@@ -10,7 +10,7 @@
"scripts/entry_point_packed_gl_enums.json":
"4f7b43863a5e61991bba4010db463679",
"scripts/generate_entry_points.py":
"a5727169ccae71f737d689a67f59e4c8",
"142d88c6897c428055ed7f0cbcc24717",
"scripts/gl.xml":
"2a73a58a7e26d8676a2c0af6d528cae6",
"scripts/gl_angle_ext.xml":
......@@ -166,9 +166,9 @@
"src/libGLESv2/libGLESv2_with_capture_autogen.def":
"301a20588e14724b390409c71d5ccfcd",
"src/libOpenCL/entry_points_cl_autogen.cpp":
"9da7a72f6afcd5af04777103612a3bee",
"228858e9707c6c1c4abe2fe618dfb2ab",
"src/libOpenCL/entry_points_cl_autogen.h":
"3b4a3094e8fd9082b71915b5bd1e8fee",
"ca2c45e4f2ae7688efac5100d5b468ad",
"src/libOpenCL/libOpenCL_autogen.cpp":
"6a44d6aedb6d21282de91bc719e7f0bf"
"5505f26e1214b5c65fd3abfb46139ef0"
}
\ No newline at end of file
......@@ -246,7 +246,7 @@ TEMPLATE_EGL_ENTRY_POINT_WITH_RETURN = """\
"""
TEMPLATE_CL_ENTRY_POINT_NO_RETURN = """\
void CL_API_ENTRY CL_{name}({params})
void CL_API_CALL CL_{name}({params})
{{
CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
......@@ -255,7 +255,7 @@ void CL_API_ENTRY CL_{name}({params})
"""
TEMPLATE_CL_ENTRY_POINT_WITH_RETURN = """\
{return_type}CL_API_ENTRY CL_{name}({params})
{return_type}CL_API_CALL CL_{name}({params})
{{
CL_EVENT({name}, "{format_params}"{comma_if_needed}{pass_params});
......@@ -327,7 +327,7 @@ CONTEXT_HEADER = """\
CONTEXT_DECL_FORMAT = """ {return_type} {name_lower_no_suffix}({internal_params}){maybe_const}; \\"""
TEMPLATE_CL_ENTRY_POINT_EXPORT = """\
ANGLE_EXPORT {return_type}CL_API_ENTRY cl{name}({params}) CL_API_CALL
{return_type} CL_API_CALL cl{name}({params})
{{
EnsureCLLoaded();
return cl_loader.cl{name}({internal_params});
......@@ -827,7 +827,7 @@ std::unique_ptr<angle::Library> &EntryPointsLib()
return *sEntryPointsLib;
}
angle::GenericProc CL_API_ENTRY GlobalLoad(const char *symbol)
angle::GenericProc CL_API_CALL GlobalLoad(const char *symbol)
{
return reinterpret_cast<angle::GenericProc>(EntryPointsLib()->getSymbol(symbol));
}
......@@ -937,6 +937,9 @@ void EnsureEGLLoaded() {}
LIBCL_HEADER_INCLUDES = """\
#include "export.h"
#ifndef CL_API_ENTRY
# define CL_API_ENTRY ANGLE_EXPORT
#endif
#include <CL/cl.h>
"""
......@@ -1186,7 +1189,7 @@ def get_api_entry_def(api):
if api == apis.EGL:
return "EGLAPIENTRY"
elif api == apis.CL:
return "CL_API_ENTRY"
return "CL_API_CALL"
else:
return "GL_APIENTRY"
......
......@@ -29,28 +29,22 @@ angle_source_set("cl_includes") {
]
}
# TODO(jplate): Fix OpenCL headers for Windows http://anglebug.com/5761
if (is_linux) {
angle_shared_library("OpenCL") {
defines = [
"CL_TARGET_OPENCL_VERSION=100",
"LIBCL_IMPLEMENTATION",
]
sources = [
"cl_loader.h",
"cl_loader_autogen.cpp",
"entry_points_cl_autogen.cpp",
"entry_points_cl_autogen.h",
"entry_points_cl_utils.h",
"libOpenCL_autogen.cpp",
]
deps = [ ":cl_includes" ]
}
angle_shared_library("OpenCL") {
defines = [
"CL_TARGET_OPENCL_VERSION=100",
"LIBCL_IMPLEMENTATION",
]
sources = [
"cl_loader.h",
"cl_loader_autogen.cpp",
"entry_points_cl_autogen.cpp",
"entry_points_cl_autogen.h",
"entry_points_cl_utils.h",
"libOpenCL_autogen.cpp",
]
deps = [ ":cl_includes" ]
}
group("angle_cl") {
# TODO(jplate): Fix OpenCL headers for Windows http://anglebug.com/5761
if (is_linux) {
data_deps = [ ":OpenCL" ]
}
data_deps = [ ":OpenCL" ]
}
......@@ -11,6 +11,9 @@
#include <export.h>
#ifndef CL_API_ENTRY
# define CL_API_ENTRY ANGLE_EXPORT
#endif
#include <CL/cl_icd.h>
ANGLE_NO_EXPORT extern cl_icd_dispatch cl_loader;
......@@ -18,7 +21,7 @@ ANGLE_NO_EXPORT extern cl_icd_dispatch cl_loader;
namespace angle
{
using GenericProc = void (*)();
using LoadProc = GenericProc(CL_API_ENTRY *)(const char *);
using LoadProc = GenericProc(CL_API_CALL *)(const char *);
ANGLE_NO_EXPORT void LoadCL(LoadProc loadProc);
} // namespace angle
......
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