Path: blob/master/3rdparty/include/opencl/1.2/CL/cl_gl.h
16348 views
/**********************************************************************************1* Copyright (c) 2008 - 2012 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* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,15* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF16* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.17* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY18* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,19* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE20* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.21**********************************************************************************/2223#ifndef __OPENCL_CL_GL_H24#define __OPENCL_CL_GL_H2526#ifdef __APPLE__27#include <OpenCL/cl.h>28#else29#include <CL/cl.h>30#endif3132#ifdef __cplusplus33extern "C" {34#endif3536typedef cl_uint cl_gl_object_type;37typedef cl_uint cl_gl_texture_info;38typedef cl_uint cl_gl_platform_info;39typedef struct __GLsync *cl_GLsync;4041/* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */42#define CL_GL_OBJECT_BUFFER 0x200043#define CL_GL_OBJECT_TEXTURE2D 0x200144#define CL_GL_OBJECT_TEXTURE3D 0x200245#define CL_GL_OBJECT_RENDERBUFFER 0x200346#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E47#define CL_GL_OBJECT_TEXTURE1D 0x200F48#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x201049#define CL_GL_OBJECT_TEXTURE_BUFFER 0x20115051/* cl_gl_texture_info */52#define CL_GL_TEXTURE_TARGET 0x200453#define CL_GL_MIPMAP_LEVEL 0x200554#define CL_GL_NUM_SAMPLES 0x2012555657extern CL_API_ENTRY cl_mem CL_API_CALL58clCreateFromGLBuffer(cl_context /* context */,59cl_mem_flags /* flags */,60cl_GLuint /* bufobj */,61int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;6263extern CL_API_ENTRY cl_mem CL_API_CALL64clCreateFromGLTexture(cl_context /* context */,65cl_mem_flags /* flags */,66cl_GLenum /* target */,67cl_GLint /* miplevel */,68cl_GLuint /* texture */,69cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2;7071extern CL_API_ENTRY cl_mem CL_API_CALL72clCreateFromGLRenderbuffer(cl_context /* context */,73cl_mem_flags /* flags */,74cl_GLuint /* renderbuffer */,75cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;7677extern CL_API_ENTRY cl_int CL_API_CALL78clGetGLObjectInfo(cl_mem /* memobj */,79cl_gl_object_type * /* gl_object_type */,80cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;8182extern CL_API_ENTRY cl_int CL_API_CALL83clGetGLTextureInfo(cl_mem /* memobj */,84cl_gl_texture_info /* param_name */,85size_t /* param_value_size */,86void * /* param_value */,87size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;8889extern CL_API_ENTRY cl_int CL_API_CALL90clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */,91cl_uint /* num_objects */,92const cl_mem * /* mem_objects */,93cl_uint /* num_events_in_wait_list */,94const cl_event * /* event_wait_list */,95cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;9697extern CL_API_ENTRY cl_int CL_API_CALL98clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,99cl_uint /* num_objects */,100const cl_mem * /* mem_objects */,101cl_uint /* num_events_in_wait_list */,102const cl_event * /* event_wait_list */,103cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;104105106// Deprecated OpenCL 1.1 APIs107extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL108clCreateFromGLTexture2D(cl_context /* context */,109cl_mem_flags /* flags */,110cl_GLenum /* target */,111cl_GLint /* miplevel */,112cl_GLuint /* texture */,113cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;114115extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL116clCreateFromGLTexture3D(cl_context /* context */,117cl_mem_flags /* flags */,118cl_GLenum /* target */,119cl_GLint /* miplevel */,120cl_GLuint /* texture */,121cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;122123/* cl_khr_gl_sharing extension */124125#define cl_khr_gl_sharing 1126127typedef cl_uint cl_gl_context_info;128129/* Additional Error Codes */130#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000131132/* cl_gl_context_info */133#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006134#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007135136/* Additional cl_context_properties */137#define CL_GL_CONTEXT_KHR 0x2008138#define CL_EGL_DISPLAY_KHR 0x2009139#define CL_GLX_DISPLAY_KHR 0x200A140#define CL_WGL_HDC_KHR 0x200B141#define CL_CGL_SHAREGROUP_KHR 0x200C142143extern CL_API_ENTRY cl_int CL_API_CALL144clGetGLContextInfoKHR(const cl_context_properties * /* properties */,145cl_gl_context_info /* param_name */,146size_t /* param_value_size */,147void * /* param_value */,148size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;149150typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)(151const cl_context_properties * properties,152cl_gl_context_info param_name,153size_t param_value_size,154void * param_value,155size_t * param_value_size_ret);156157#ifdef __cplusplus158}159#endif160161#endif /* __OPENCL_CL_GL_H */162163164