CLGETGLTEXTUREINFO(3clc)
π clGetGLTextureInfo β the OpenCL manual, but make it cute
okay bestie, so this is clGetGLTextureInfo(3clc) from the OpenCL Manual and it's literally the function that spills the tea about a GL texture object that's been linked up to a memory object. like, you already made the friendship bracelet between CL and GL, and now you wanna know which texture it is? yeah. this is that. π¦
β¨ NAME β¨
clGetGLTextureInfo β returns extra info about the GL texture object that's associated with a memory object. no cap, that's the whole job.
πΈ SYNOPSIS πΈ
cl_int clGetGLTextureInfo(cl_mem memobj, cl_gl_texture_info param_name,
size_t param_value_size, void *param_value,
size_t *param_value_size_ret);
π PARAMETERS π
param_nameβ tells the function what extra info about the GL texture object tied tomemobjyou wanna ask about. the supportedparam_nametypes and what actually comes back inparam_valueare listed in the table below (yes, I turned the table into a list, we're aesthetic now).param_valueβ a pointer to memory where the queried result gets dropped off. ifparam_valueisNULL, bestie, it's just ignored. it said "not my problem." πparam_value_sizeβ the size in bytes of the memory thatparam_valuepoints at. this size must be β₯ the size of the return type described in the table below. don't skimp. πparam_value_size_retβ returns the actual size in bytes of the data that got copied intoparam_value. ifparam_value_size_retisNULL, it is ignored. also valid, also respected.
the info table, but make it a list β¨
CL_GL_TEXTURE_TARGETβ return type:GLenum. gives you back thetexture_targetargument that was specified inclCreateFromGLTexture(3clc). π―CL_GL_MIPMAP_LEVELβ return type:GLint. gives you back themiplevelargument that was specified inclCreateFromGLTexture(3clc). mipmap levels are so underrated, lowkey iconic. π
π₯ ERRORS π₯
returns CL_SUCCESS if the function executed successfully, periodt. otherwise it hands you one of these:
CL_INVALID_MEM_OBJECTifmemobjis not a valid OpenCL memory object. π«CL_INVALID_GL_OBJECTif there is no GL texture object associated withmemobj. like, there's nothing there. empty. void. πCL_INVALID_VALUEifparam_nameis not valid, or if the size in bytes specified byparam_value_sizeis < the size of the return type described in the table above andparam_valueis notNULL, or ifparam_valueandparam_value_size_retare bothNULL. three whole ways to mess this up bestie, be careful. πCL_OUT_OF_RESOURCESif there's a failure to allocate resources required by the OpenCL implementation on the device. π΅CL_OUT_OF_HOST_MEMORYif there's a failure to allocate resources required by the OpenCL implementation on the host. π΅βπ«
π SPECIFICATION π
OpenCL Specification[1]
π SEE ALSO π
cl_khr_gl_sharing(3clc), clGetGLObjectInfo(3clc), clCreateFromGLTexture(3clc), clCreateFromGLTexture(3clc)
yes it lists clCreateFromGLTexture(3clc) twice. no I did not fix it. I do not fix things. I preserve them. π
π«Ά 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 π
- OpenCL Specification β page 55, section 9.7.5 - Querying GL object information from a CL...
and that's the whole page, bestie!! this little legend came from The Khronos Group and it's dated 01/14/2021 β shoutout to the CLGETGLTEXTUREINFO(3clc) footer for keeping us honest. go forth and query those GL textures, you absolute main character. πβ¨π¦
π¦ where this page comes from
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms