---
name: "clGetGLObjectInfo"
section: "3clc"
platform: "linux"
package: "opencl-1.2-man-doc"
version: "1.0~svn33624-5.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/clGetGLObjectInfo"
---

# clGetGLObjectInfo(3clc)

Query an OpenGL memory object used to create an OpenCL memory object.

## NAME

clGetGLObjectInfo - Query an OpenGL memory object used to create an OpenCL memory object.

##

**cl\_int clGetGLObjectInfo(cl\_mem** *memobj***, cl\_gl\_object\_type \****gl\_object\_type***, GLuint \****gl\_object\_name***);**

## PARAMETERS

*gl\_object\_type*

Returns the type of GL 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\_OBJECT\_TEXTURE\_BUFFER**, or **CL\_GL\_OBJECT\_RENDERBUFFER**. If *gl\_object\_type* is NULL, it is ignored.

 *gl\_object\_name*

Returns the GL object name used to create *memobj*. If *gl\_object\_name* is NULL, it is ignored.

## DESCRIPTION

The OpenGL object used to create the OpenCL memory object and information about the object type i.e. whether it is a texture, renderbuffer, or buffer object can be queried using this function.

## ERRORS

Returns CL\_SUCCESS if the call was executed successfully. Otherwise, it returns one of the following errors:

• CL\_INVALID\_MEM\_OBJECT if *memobj* is not a valid OpenCL memory object.

• CL\_INVALID\_GL\_OBJECT if there is no GL object associated with *memobj*.

• CL\_OUT\_OF\_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

• CL\_OUT\_OF\_HOST\_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

## SPECIFICATION

**OpenCL Specification**\[1\]

## SEE ALSO

[**cl\_khr\_gl\_sharing**(3clc)](/cl_khr_gl_sharing/3clc.md), [**clGetGLTextureInfo**(3clc)](/clGetGLTextureInfo/3clc.md)

## AUTHORS

**The Khronos Group**

## COPYRIGHT

Copyright © 2007-2011 The Khronos Group Inc.\
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.

## NOTES

- 1\.

  OpenCL Specification

  page 54, section 9.7.5 - Querying GL object information from a CL...
