C Specification
To query the OpenGL object and object type used to create an OpenCL memory object, call the function
// Provided by cl_khr_gl_sharing
cl_int clGetGLObjectInfo(
cl_mem memobj,
cl_gl_object_type* gl_object_type,
cl_GLuint* gl_object_name);
clGetGLObjectInfo is provided by the cl_khr_gl_sharing extension.
|
Parameters
-
memobj is the memory object to query.
-
gl_object_type returns the type of OpenGL object attached to memobj and can be
CL_GL_,OBJECT_ BUFFER CL_GL_,OBJECT_ TEXTURE2D CL_GL_,OBJECT_ TEXTURE3D CL_GL_,OBJECT_ TEXTURE2D_ ARRAY CL_GL_,OBJECT_ TEXTURE1D CL_GL_,OBJECT_ TEXTURE1D_ ARRAY CL_GL_, orOBJECT_ TEXTURE_ BUFFER CL_GL_. If gl_object_type isOBJECT_ RENDERBUFFER NULL, it is ignored -
gl_object_name returns the OpenGL object name used to create memobj. If gl_object_name is
NULL, it is ignored.
Description
clGetGLObjectInfo returns CL_SUCCESS if the call was executed
successfully.
Otherwise, it returns one of the following errors:
-
CL_INVALID_if memobj is not a valid OpenCL memory object.MEM_ OBJECT -
CL_INVALID_if there is no OpenGL object associated with memobj.GL_ OBJECT -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY
Document Notes
For more information, see the OpenCL Specification
This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.