GLDEBUGMESSAGECONTRO(3G)

πŸ’… GLDEBUGMESSAGECONTRO (that's the 3G manual, bestie) ✨


🌸 NAME 🌸

glDebugMessageControl β€” ok so this is the function that lets you control the reporting of debug messages in a debug context. Basically you're the bouncer at the club and you decide which debug messages get in πŸ’…


πŸŽ€ C SPECIFICATION πŸŽ€

void glDebugMessageControl(GLenum source, GLenum type, GLenum severity,
                           GLsizei count, const GLuint *ids,
                           GLboolean enabled);

Like, literally copy that exactly, the parameter order matters, don't improvise 🫢


✨ PARAMETERS ✨

  • source β€” where the debug messages you're enabling/disabling are coming from. The origin story, if you will.
  • type β€” what kind of debug messages you're enabling or disabling.
  • severity β€” how serious those messages are. The vibe check of the message, lowkey.
  • count β€” the length of the array ids. Just how many ids you're handing over.
  • ids β€” the address of an array of unsigned integers contianing the ids of the messages to enable or disable. (Yes, "contianing" β€” that's how it's spelled in the original, I'm not fixing it, I don't make the rules 😭)
  • enabled β€” a Boolean flag determining whether the selected messages should be enabled or disabled. On or off, bestie, pick one πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

So glDebugMessageControl controls the reporting of debug messages generated by a debug context. The parameters source, type and severity form a filter to select messages from the pool of potential messages generated by the GL. Think of it like a group chat β€” you're muting and unmuting specific people πŸ”‡

On source: it may be GL_DEBUG_SOURCE_API, GL_DEBUG_SOURCE_WINDOW_SYSTEM_, GL_DEBUG_SOURCE_SHADER_COMPILER, GL_DEBUG_SOURCE_THIRD_PARTY, GL_DEBUG_SOURCE_APPLICATION, or GL_DEBUG_SOURCE_OTHER to select messages generated by usage of the GL API, the window system, the shader compiler, third party tools or libraries, explicitly by the application, or by some other source, respectively. (And yes, GL_DEBUG_SOURCE_WINDOW_SYSTEM_ really does have that trailing underscore in this page β€” I am not touching it, she said what she said πŸ’…) It may also take the value GL_DONT_CARE. If source is not GL_DONT_CARE then only messages whose source matches source will be referenced.

On type: it may be one of GL_DEBUG_TYPE_ERROR, GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, GL_DEBUG_TYPE_PORTABILITY, GL_DEBUG_TYPE_PERFORMANCE, GL_DEBUG_TYPE_MARKER, GL_DEBUG_TYPE_PUSH_GROUP, GL_DEBUG_TYPE_POP_GROUP, or GL_DEBUG_TYPE_OTHER to indicate the type of messages describing GL errors, attempted use of deprecated features, triggering of undefined behavior, portability issues, performance notifications, markers, group push and pop events, and other types of messages, respectively. It may also take the value GL_DONT_CARE. If type is not GL_DONT_CARE then only messages whose type matches type will be referenced.

On severity: it may be one of GL_DEBUG_SEVERITY_LOW, GL_DEBUG_SEVERITY_MEDIUM, or GL_DEBUG_SEVERITY_HIGH to select messages of low, medium or high severity messages, or to GL_DEBUG_SEVERITY_NOTIFICATION for notifications. It may also take the value GL_DONT_CARE. If severity is not GL_DONT_CARE then only messages whose severity matches severity will be referenced.

On ids (the spicy part 🌢️): ids contains a list of count message identifiers to select specific messages from the pool of available messages. If count is zero then the value of ids is ignored. Otherwise, only messages appearing in this list are selected. In this case, source and type may not be GL_DONT_CARE and severity must be GL_DONT_CARE. Like, read that twice, it's giving "special rules apply" energy πŸ‘‘

And enabled: if enabled is GL_TRUE then messages that match the filter formed by source, type, severity and ids are enabled. Otherwise, those messages are disabled. Periodt.


πŸ’œ NOTES πŸ’œ

  • Although debug messages may be enabled in a non-debug context, the quantity and detail of such messages may be substantially inferior to those in a debug context. Like, the non-debug version is the group chat without the tea 🍡
  • In particular, a valid implementation of the debug message queue in a non-debug context may produce no messages at all. Nothing. Crickets. Not a single peep πŸ’€
So fr fr: GL_DEBUG_TYPE_MARKER, GL_DEBUG_TYPE_PUSH_GROUP, GL_DEBUG_TYPE_POP_GROUP, and GL_DEBUG_SEVERITY_NOTIFICATION are available only if the GL version is 4.3 or higher. Don't come crying to me if you're on 3.3 and these aren't showing up πŸ™ˆ

πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_VALUE is generated if count is negative. Negative count is not the vibe, ma'am 😭
  • GL_INVALID_ENUM is generated if any of source, type or severity is not one of the accepted interface types.
  • GL_INVALID_OPERATION is generated if count is non-zero and either source or type is GL_DONT_CARE or if severity is not GL_DONT_CARE. Yeah I know, that one's a mouthful β€” screenshot it πŸ“Έ

πŸ‘‘ VERSION SUPPORT πŸ‘‘

Ok so picture the chart in your head, bestie β€” here's the function name and where she shows up across the OpenGL versions:

  • Function / Feature Name: glDebugMessageControl
  • 2.0 β€” - (nope)
  • 2.1 β€” - (nope)
  • 3.0 β€” - (nope)
  • 3.1 β€” - (nope)
  • 3.2 β€” - (nope)
  • 3.3 β€” - (nope)
  • 4.0 β€” - (nope)
  • 4.1 β€” - (nope)
  • 4.2 β€” - (nope)
  • 4.3 β€” βœ” (THERE she is ✨)
  • 4.4 β€” βœ” (slay)
  • 4.5 β€” βœ” (slay again)

So basically: 4.3 and up, and nowhere else. She's a late bloomer and that's iconic 🌈


🌟 SEE ALSO 🌟

  • glDebugMessageInsert()
  • glDebugMessageCallback()
  • glGetDebugMessageLog()

Copyright Β© 2013-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

Copyright Β© 2013-2014 Khronos Group


And that's the whole page, bestie!! 🫢 Go forth and control your debug messages β€” this was GLDEBUGMESSAGECONTRO, from that [FIXME: source] situation, dated 08/09/2021. Mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from