CLGETGLTEXTUREINFO(3clc)

πŸ“¦
version 1.0~svn33624 Β· 3 versions
, in ubuntu jammy, ubuntu noble

πŸ’… 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 to memobj you wanna ask about. the supported param_name types and what actually comes back in param_value are 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. if param_value is NULL, bestie, it's just ignored. it said "not my problem." πŸ’€
  • param_value_size β€” the size in bytes of the memory that param_value points 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 into param_value. if param_value_size_ret is NULL, 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 the texture_target argument that was specified in clCreateFromGLTexture(3clc). 🎯
  • CL_GL_MIPMAP_LEVEL β€” return type: GLint. gives you back the miplevel argument that was specified in clCreateFromGLTexture(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_OBJECT if memobj is not a valid OpenCL memory object. 🚫
  • CL_INVALID_GL_OBJECT if there is no GL texture object associated with memobj. like, there's nothing there. empty. void. 😭
  • CL_INVALID_VALUE if param_name is not valid, or if the size in bytes specified by param_value_size is < the size of the return type described in the table above and param_value is not NULL, or if param_value and param_value_size_ret are both NULL. three whole ways to mess this up bestie, be careful. πŸ’€
  • CL_OUT_OF_RESOURCES if there's a failure to allocate resources required by the OpenCL implementation on the device. 😡
  • CL_OUT_OF_HOST_MEMORY if 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 Β© 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 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